Your IP : 216.73.216.134


Current Path : /opt/rh/rh-python35/root/lib64/python3.5/http/__pycache__/
Upload File :
Current File : //opt/rh/rh-python35/root/lib64/python3.5/http/__pycache__/cookies.cpython-35.opt-1.pyc



���\4S�
@sdZddlZddlZdddgZdjZdjZdjZd	d
�ZGdd�de	�Z
ejejdZ
e
d
Zdd�eed��eeee��D�Zejed�ded�di�ejde
�jZdd�Zejd�Zejd�Zdd�Zddddd d!d"gZdd#d$d%d&d'd(d)d*d+d,d-d.g
Zdeed/d0�ZGd1d2�d2e�Z d3Z!e!d4Z"ejd5e!d6e"d7ej#�Z$Gd8d�de�Z%Gd9d�de%�Z&dS):a.

Here's a sample session to show how to use this module.
At the moment, this is the only documentation.

The Basics
----------

Importing is easy...

   >>> from http import cookies

Most of the time you start by creating a cookie.

   >>> C = cookies.SimpleCookie()

Once you've created your Cookie, you can add values just as if it were
a dictionary.

   >>> C = cookies.SimpleCookie()
   >>> C["fig"] = "newton"
   >>> C["sugar"] = "wafer"
   >>> C.output()
   'Set-Cookie: fig=newton\r\nSet-Cookie: sugar=wafer'

Notice that the printable representation of a Cookie is the
appropriate format for a Set-Cookie: header.  This is the
default behavior.  You can change the header and printed
attributes by using the .output() function

   >>> C = cookies.SimpleCookie()
   >>> C["rocky"] = "road"
   >>> C["rocky"]["path"] = "/cookie"
   >>> print(C.output(header="Cookie:"))
   Cookie: rocky=road; Path=/cookie
   >>> print(C.output(attrs=[], header="Cookie:"))
   Cookie: rocky=road

The load() method of a Cookie extracts cookies from a string.  In a
CGI script, you would use this method to extract the cookies from the
HTTP_COOKIE environment variable.

   >>> C = cookies.SimpleCookie()
   >>> C.load("chips=ahoy; vienna=finger")
   >>> C.output()
   'Set-Cookie: chips=ahoy\r\nSet-Cookie: vienna=finger'

The load() method is darn-tootin smart about identifying cookies
within a string.  Escaped quotation marks, nested semicolons, and other
such trickeries do not confuse it.

   >>> C = cookies.SimpleCookie()
   >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";')
   >>> print(C)
   Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;"

Each element of the Cookie also supports all of the RFC 2109
Cookie attributes.  Here's an example which sets the Path
attribute.

   >>> C = cookies.SimpleCookie()
   >>> C["oreo"] = "doublestuff"
   >>> C["oreo"]["path"] = "/"
   >>> print(C)
   Set-Cookie: oreo=doublestuff; Path=/

Each dictionary element has a 'value' attribute, which gives you
back the value associated with the key.

   >>> C = cookies.SimpleCookie()
   >>> C["twix"] = "none for you"
   >>> C["twix"].value
   'none for you'

The SimpleCookie expects that all values should be standard strings.
Just to be sure, SimpleCookie invokes the str() builtin to convert
the value to a string, when the values are set dictionary-style.

   >>> C = cookies.SimpleCookie()
   >>> C["number"] = 7
   >>> C["string"] = "seven"
   >>> C["number"].value
   '7'
   >>> C["string"].value
   'seven'
   >>> C.output()
   'Set-Cookie: number=7\r\nSet-Cookie: string=seven'

Finis.
�N�CookieError�
BaseCookie�SimpleCookie�z; � cCs0ddl}d|}|j|tdd�dS)NrzvThe .%s setter is deprecated. The attribute will be read-only in future releases. Please use the set() method instead.�
stacklevel�)�warnings�warn�DeprecationWarning)�setterr	�msg�r�</opt/rh/rh-python35/root/usr/lib64/python3.5/http/cookies.py�_warn_deprecated_setter�src@seZdZdS)rN)�__name__�
__module__�__qualname__rrrrr�sz!#$%&'*+-.^_`|~:z
 ()/<=>?@[]{}cCsi|]}d||�qS)z\%03or)�.0�nrrr�
<dictcomp>�s	r��"z\"�\z\\z[%s]+cCs5|dkst|�r|Sd|jt�dSdS)z�Quote a string for use in a cookie header.

    If the string does not need to be double-quoted, then just return the
    string.  Otherwise, surround the string in doublequotes and quote
    (with a \) special characters.
    Nr)�
_is_legal_key�	translate�_Translator)�strrrr�_quote�srz\\[0-3][0-7][0-7]z[\\].cCs�|dkst|�dkr"|S|ddksB|ddkrF|S|dd�}d}t|�}g}x?d|ko�|knr�tj||�}tj||�}|r�|r�|j||d��Pd	}}|r�|jd�}|r|jd�}|r]|s$||kr]|j|||��|j||d�|d}qq|j|||��|jtt||d|d�d���|d}qqWt|�S)
N�rr������r#r#)	�len�
_OctalPatt�search�
_QuotePatt�append�start�chr�int�	_nulljoin)r�ir�resZo_matchZq_match�j�krrr�_unquote�s6 

.r1ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc	Csoddlm}m}|�}|||�\	}}}}	}
}}}
}d|||||||	|
|fS)Nr)�gmtime�timez#%s, %02d %3s %4d %02d:%02d:%02d GMT)r3r2)ZfutureZweekdaynameZ	monthnamer2r3ZnowZyearZmonthZdayZhhZmmZssZwd�y�zrrr�_getdate�s
	+r6c@s�eZdZdZddddddddd	d
ddd
dddiZdd
hZdd�Zedd��Zej	dd��Zedd��Z
e
j	dd��Z
edd��Zej	dd��Zdd�Zddd �Z
d!d"�ZejZd#d$�Zd%d&�Zd'd(�Zed)d*�Zd+d,�Zd-d.�Zdd/d0d1�ZeZd2d3�Zdd4d5�Zdd6d7�ZdS)8�Morsela�A class to hold ONE (key, value) pair.

    In a cookie, each such pair may have several attributes, so this class is
    used to keep the attributes associated with the appropriate key,value pair.
    This class also includes a coded_value attribute, which is used to hold
    the network representation of the value.  This is most useful when Python
    objects are pickled for network transit.
    �expires�pathZPathZcomment�CommentZdomainZDomainzmax-agezMax-AgeZsecureZSecureZhttponlyZHttpOnly�versionZVersioncCsBd|_|_|_x$|jD]}tj||d�q!WdS)Nr)�_key�_value�_coded_value�	_reserved�dict�__setitem__)�self�keyrrr�__init__&szMorsel.__init__cCs|jS)N)r<)rBrrrrC.sz
Morsel.keycCstd�||_dS)NrC)rr<)rBrCrrrrC2s
cCs|jS)N)r=)rBrrr�value7szMorsel.valuecCstd�||_dS)NrE)rr=)rBrErrrrE;s
cCs|jS)N)r>)rBrrr�coded_value@szMorsel.coded_valuecCstd�||_dS)NrF)rr>)rBrFrrrrFDs
cCsE|j�}||jkr.td|f��tj|||�dS)NzInvalid attribute %r)�lowerr?rr@rA)rB�K�VrrrrAIszMorsel.__setitem__NcCsA|j�}||jkr.td|f��tj|||�S)NzInvalid attribute %r)rGr?rr@�
setdefault)rBrC�valrrrrJOszMorsel.setdefaultcCsYt|t�stStj||�oX|j|jkoX|j|jkoX|j|jkS)N)�
isinstancer7�NotImplementedr@�__eq__r=r<r>)rB�morselrrrrNUsz
Morsel.__eq__cCs0t�}tj||�|jj|j�|S)N)r7r@�update�__dict__)rBrOrrr�copy_s	zMorsel.copycCsui}xXt|�j�D]D\}}|j�}||jkrStd|f��|||<qWtj||�dS)NzInvalid attribute %r)r@�itemsrGr?rrP)rB�values�datarCrKrrrrPesz
Morsel.updatecCs|j�|jkS)N)rGr?)rBrHrrr�
isReservedKeynszMorsel.isReservedKeycCs�|tkr.ddl}|jdtdd�|j�|jkrVtd|f��t|�sutd|f��||_||_	||_
dS)NrzSLegalChars parameter is deprecated, ignored and will be removed in future versions.rrz Attempt to set a reserved key %rzIllegal key %r)�_LegalCharsr	r
rrGr?rrr<r=r>)rBrCrKZ	coded_valZ
LegalCharsr	rrr�setqs		z
Morsel.setcCsd|jd|jd|jiS)NrCrErF)r<r=r>)rBrrr�__getstate__�s		zMorsel.__getstate__cCs+|d|_|d|_|d|_dS)NrCrErF)r<r=r>)rB�staterrr�__setstate__�s

zMorsel.__setstate__zSet-Cookie:cCsd||j|�fS)Nz%s %s)�OutputString)rB�attrs�headerrrr�output�sz
Morsel.outputcCsd|jj|j�fS)Nz<%s: %s>)�	__class__rr\)rBrrr�__repr__�szMorsel.__repr__cCsd|j|�jdd�S)Nz�
        <script type="text/javascript">
        <!-- begin hiding
        document.cookie = "%s";
        // end hiding -->
        </script>
        rz\")r\�replace)rBr]rrr�	js_output�szMorsel.js_outputcCsQg}|j}|d|j|jf�|dkr>|j}t|j��}x�|D]�\}}|dkrrqW||kr�qW|dkr�t|t�r�|d|j|t|�f�qW|dkr�t|t�r�|d|j||f�qW||j	kr(|rC|t
|j|��qW|d|j||f�qWWt|�S)Nz%s=%srr8zmax-agez%s=%d)r(rCrFr?�sortedrSrLr+r6�_flagsr�_semispacejoin)rBr]�resultr(rSrCrErrrr\�s(		$zMorsel.OutputString)rrr�__doc__r?rerD�propertyrCrrErFrArJrN�object�__ne__rRrPrVrWrXrYr[r_�__str__rarcr\rrrrr7s@		
r7z,\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=z\[\]z�
    (?x)                           # This is a verbose pattern
    \s*                            # Optional whitespace at start of cookie
    (?P<key>                       # Start of group 'key'
    [a	]+?   # Any word of at least one letter
    )                              # End of group 'key'
    (                              # Optional group: there may not be a value.
    \s*=\s*                          # Equal Sign
    (?P<val>                         # Start of group 'val'
    "(?:[^\\"]|\\.)*"                  # Any doublequoted string
    |                                  # or
    \w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT  # Special case for "expires" attr
    |                                  # or
    [a-]*      # Any word or empty string
    )                                # End of group 'val'
    )?                             # End of optional value group
    \s*                            # Any number of spaces.
    (\s+|;|$)                      # Ending either at space, semicolon, or EOS.
    c@s�eZdZdZdd�Zdd�Zddd�Zd	d
�Zdd�Zdd
ddd�Z	e	Z
dd�Zddd�Zdd�Z
edd�ZdS)rz'A container class for a set of Morsels.cCs
||fS)a
real_value, coded_value = value_decode(STRING)
        Called prior to setting a cookie's value from the network
        representation.  The VALUE is the value read from HTTP
        header.
        Override this function to modify the behavior of cookies.
        r)rBrKrrr�value_decode�szBaseCookie.value_decodecCst|�}||fS)z�real_value, coded_value = value_encode(VALUE)
        Called prior to setting a cookie's value from the dictionary
        representation.  The VALUE is the value being assigned.
        Override this function to modify the behavior of cookies.
        )r)rBrK�strvalrrr�value_encode�szBaseCookie.value_encodeNcCs|r|j|�dS)N)�load)rB�inputrrrrD�szBaseCookie.__init__cCs?|j|t��}|j|||�tj|||�dS)z+Private method for setting a cookie's valueN)�getr7rXr@rA)rBrCZ
real_valuerF�MrrrZ__set�szBaseCookie.__setcCsQt|t�r%tj|||�n(|j|�\}}|j|||�dS)zDictionary style assignment.N)rLr7r@rAro�_BaseCookie__set)rBrCrE�rval�cvalrrrrAszBaseCookie.__setitem__zSet-Cookie:z
cCsUg}t|j��}x-|D]%\}}|j|j||��qW|j|�S)z"Return a string suitable for HTTP.)rdrSr(r_�join)rBr]r^�seprgrSrCrErrrr_s
zBaseCookie.outputcCsig}t|j��}x4|D],\}}|jd|t|j�f�qWd|jjt|�fS)Nz%s=%sz<%s: %s>)rdrSr(�reprrEr`r�
_spacejoin)rB�lrSrCrErrrras
$zBaseCookie.__repr__cCsOg}t|j��}x*|D]"\}}|j|j|��qWt|�S)z(Return a string suitable for JavaScript.)rdrSr(rcr,)rBr]rgrSrCrErrrrcs
zBaseCookie.js_outputcCsJt|t�r|j|�n'x$|j�D]\}}|||<q,WdS)z�Load cookies from a string (presumably HTTP_COOKIE) or
        from a dictionary.  Loading cookies from a dictionary 'd'
        is equivalent to calling:
            map(Cookie.__setitem__, d.keys(), d.values())
        N)rLr�_BaseCookie__parse_stringrS)rBZrawdatarCrErrrrp%s
zBaseCookie.loadcCs�d}t|�}g}d}d}d}xZd|koD|knr�|j||�}	|	sbP|	jd�|	jd�}
}|	jd�}|
ddkr�|s�q-|j||
dd�|f�q-|
j�tjkrK|s�dS|dkr,|
j�tjkr%|j||
df�qHdSq�|j||
t	|�f�q-|dk	r|j||
|j
|�f�d}q-dSq-Wd}xY|D]Q\}
}
}|
|kr�|||
<q�|\}}|j|
||�||
}q�WdS)	NrFr rrCrK�$T)r$�match�group�endr(rGr7r?rer1rmrt)rBrZpattr-rZparsed_itemsZmorsel_seenZTYPE_ATTRIBUTEZ
TYPE_KEYVALUEr~rCrErs�tprurvrrrZ__parse_string3sF#	
zBaseCookie.__parse_string)rrrrhrmrorDrtrAr_rlrarcrp�_CookiePatternr|rrrrr�s			c@s.eZdZdZdd�Zdd�ZdS)rz�
    SimpleCookie supports strings as cookie values.  When setting
    the value using the dictionary assignment notation, SimpleCookie
    calls the builtin str() to convert the value to a string.  Values
    received from HTTP are kept as strings.
    cCst|�|fS)N)r1)rBrKrrrrmwszSimpleCookie.value_decodecCst|�}|t|�fS)N)rr)rBrKrnrrrrozszSimpleCookie.value_encodeN)rrrrhrmrorrrrrps)'rh�re�string�__all__rwr,rfrzr�	ExceptionrZ
ascii_lettersZdigitsrWZ_UnescapedCharsrX�range�map�ordrrP�compile�	fullmatchrrr%r'r1Z_weekdaynameZ
_monthnamer6r@r7Z_LegalKeyCharsZ_LegalValueChars�ASCIIr�rrrrrr�<module>sB				
	)
2�

�

Rosenblum TV: Video training, virtual workshops, classes, tutorials
logologologologo
  • About
  • What We Do
  • Our Clients
  • Case Studies
    • The BBC
    • CBS News
    • New York Times Television
    • Spectrum News
    • The Newark Star-Ledger
    • The United Nations
    • McGraw/Hill
    • Oyster Yachts
    • Scottish Environmental Protection Agency
  • The Power of Storytelling
  • Why iPhones?
  • Michael on Media
  • Books
  • Contact
  • About
  • What We Do
  • Our Clients
  • Case Studies
    • The BBC
    • CBS News
    • New York Times Television
    • Spectrum News
    • The Newark Star-Ledger
    • The United Nations
    • McGraw/Hill
    • Oyster Yachts
    • Scottish Environmental Protection Agency
  • The Power of Storytelling
  • Why iPhones?
  • Michael on Media
  • Books
  • Contact

RE-INVENTING THE TELEVISION NEWS BUSINESS*

A revolution in video storytelling

Creating entirely new & cost-effective production methods

From the world leaders in video production training and the creators of Character Driven Storytelling™

*and every other business that uses video

WHAT WE DO

Over the past 35 years, we have designed, built or restructured some of the most powerful news and journalism companies in the world.

We replace the traditional TV news ‘crew’ with one highly trained journalist, working alone with nothing but an iPhone.

No more TV news ‘crews’, no editors and no field producers.

This is television news done the way newspaper journalism is done – one reporter with their electronic pad and pencil.

In doing this, we can cut the cost of production by as much as 75% while increasing ratings and audience engagement.

In the place of conventional TV news ‘packages’ – ie, reporter stand up, interview, b-roll, man on the street, we marry great journalism with Netflix and Hollywood storytelling.

It’s a combination that works.

We have taken most of our clients to #1 in their respective markets.

And it’s not just for news. Any company, any profit, any NGO and anyone else who is online needs to tell their story in compelling yet cost-effective video. We can teach you to do that. Either in person or virtually.

EXAMPLES OF WHAT WE CAN TEACH YOUR STAFF TO PRODUCE

ITAY HOD

Itay Hod, MMJ with KPIX/CBS in San Francisco, took the 5-Day Intensive Video Storytelling Bootcamp in 2018.

Because he works alone, with only an iPhone, he was able to embed himself with a homeless family.

Here’s the story he produced in a one-day turn.

KIET DO

Kiet Do, an MMJ with KPIX/CBS in San Francisco, took the 5-Day Intensive Video Storytelling Bootcamp in 2021.

Here is a story he produced, all on his own, with only an iPhone and in a one-day turn.

TAYLOR SCHAUB

Taylor Schaub, an MMJ with Spectrum News 1 in LA, took the 5-Day Intensive Video Storytelling Bootcamp in 2023.

Here is a story he turned in only one day, using only an iPhone. It was the first video story he ever did and it was nominated for an Emmy.

THE BOOTCAMP

How do we convert stations and whole networks to working in this way?

Since 1988, we have run intensive 5-Day Video Storytelling Bootcamps

We have done these all over the world.

These are hands-on bootcamps, and participants learn an entirely new way of creating TV news stories.

-We shoot at a 3:1 ratio or lower, so turnaround times are fast.

-We go directly from camera to timelilne and edit – no written scripts.  We work in the medium of pictures and sound.

-We are entirely character-driven.

-We are driven by pictures and real events.

-We are focused almost entirely on ’the viewer experience’.

Since 1988, more than 70,000 journalists around the world have taken our bootcamps, either in person on virtualy.

Case Studies

CBS Case Study Logos
CBS News

We have started to work with CBS News, bringing our ideas of character-driven storytelling to one of the most successful and biggest networks in the United States. Since beginning to work with them ratings have climbed and more importantly, audience engagement is through the ceiling.

Learn More
NYT Case Study Logos
New York Times Television

We started New York Times Television in 1990 and it was the first paper to be brought into the world of TV. It quickly became one of the most successful non-fiction production companies in the United States. The series and documentaries we produced won many awards including multiple Emmys.

Learn More
BBC Case Study Logos
The BBC

We have been working with the BBC since the year 2000 helping to convert their national news network to our visual storytelling technique. Most recently we have trained teams from their sports, documentaries, and comedy divisions to make character-driven stories using only smartphones.

Learn More
Spectrum Case Study Logos
Spectrum News

For the past five years we have worked with Spectrum News to introduce and train their journalists on visual, character driven storytelling using smartphones helping to create a different kind of local news for their network of 24-Hour News Stations across the United States.

Learn More
UN Case Study Logos
The United Nations

In 2006, we were approached by the United Nations. Rather than rely on news outlets, it would be much easier to train the field operatives to produce their own stories. We spent two years working with the UN, training more than 100 of their staff in bootcamps in Geneva and Nairobi.

Learn More
Star Ledger Case Study Logos
The Newark Star-Ledger

We trained 50 print reporters at the paper to shoot and tell their own stories, in conjunction with their print work. We built a TV newsroom in their existing print newsroom – you could not ask for a better set and they began to live stream their stories in conjunction with their print work.

Learn More
Mcgraw Hill Case Study Logos
Mcgraw Hill

We spent two years with McGraw Hill, training more than 150 of their staffers, making them completely video literate. McGraw/Hill media properties we transit included Business Week, Aviation Week, (what was the name of the architecture magazine), and JD Power and Associates.

Learn More
VOA Case Study Logos
Voice of America

In 1990, we were approached by The Voice of America, the official broadcasting agency for the United States Government. When we met with VOA, they were only a short wave radio broadcaster, but working with them, we took them into television, launching VOA-TV.

Learn More
Oyster Case Study Logos
Oyster Yachts

British based Oyster Yachts makes some of the finest yachts in the world. Like every other company, they had to find a way to feed the never-ending video demands of social media – sites like Instagram and TikTok. We trained the Oyster staff to tell their own stories, using only iPhones.

Learn More
SEPA Case Study Logos
Scottish Environmental Protection Agency

We were approached by SEPA, the Scottish Environmental Protection Agency because they had to continually find a way to ‘feed the media beast’. The result was that SEPA was able to tell their own stories, whenever they wanted, and at almost no additional cost.

Learn More
Image 11-11-22 at 6.25 PM

Michael on Media

Michael Rosenblum has been writing about the media since 1988. His work and ideas have appeared in The Guardian, The Huffington Post, Ilkeston Life and many other publications.

He has been blogging regularly for the past 35 years on this subject. Having taught media studies at Columbia University, NYU and now the University of Oxford, he is considered an expert on this subject.

Continue reading this post or look back at previous posts.

Read More

Do You Have Questions About Learning Video Skills?

If you would like to know more about our courses contact us and one of our training advisors will be happy to call you.

Contact Us

Copyright 2024. All rights reserved.