rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
if neg_opt.has_key(option): | is_string = type(value) is StringType if neg_opt.has_key(option) and is_string: | def _set_command_options (self, command_obj, option_dict=None): """Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). | 29045520b2406b9426410e5690df01e142161b7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/29045520b2406b9426410e5690df01e142161b7b/dist.py |
elif option in bool_opts: | elif option in bool_opts and is_string: | def _set_command_options (self, command_obj, option_dict=None): """Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). | 29045520b2406b9426410e5690df01e142161b7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/29045520b2406b9426410e5690df01e142161b7b/dist.py |
... >>> x/2 | ... >>> x//2 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
... >>> x/2 | ... >>> x//2 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
... >>> x/2 | ... >>> x//2 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
x/2 | x//2 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
... >>> x/2 | ... >>> x//2 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
x/2 | x//2 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
x/2 | x//2 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
... >>> print x/0 | ... >>> print x//0 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
... >>> print 'pre-exception output', x/0 | ... >>> print 'pre-exception output', x//0 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
print 'pre-exception output', x/0 | print 'pre-exception output', x//0 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
... >>> 1/0 | ... >>> 1//0 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
1/0 | 1//0 | >>> def f(x): | a234b5762eb4de6cb8ecae9c9cb84c877a302afe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a234b5762eb4de6cb8ecae9c9cb84c877a302afe/test_doctest.py |
Read header lines up to the entirely blank line that terminates them. The (normally blank) line that ends the headers is skipped, but not included in the returned list. If a non-header line ends the headers, (which is an error), an attempt is made to backspace over it; it is never included in the returned list. The variable self.status is set to the empty string if all went well, otherwise it is an error message. The variable self.headers is a completely uninterpreted list of lines contained in the header (so printing them will reproduce the header exactly as it appears in the file). | Read header lines up to the entirely blank line that terminates them. The (normally blank) line that ends the headers is skipped, but not included in the returned list. If a non-header line ends the headers, (which is an error), an attempt is made to backspace over it; it is never included in the returned list. The variable self.status is set to the empty string if all went well, otherwise it is an error message. The variable self.headers is a completely uninterpreted list of lines contained in the header (so printing them will reproduce the header exactly as it appears in the file). | def readheaders(self): """Read header lines. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
You may override this method in order to use Message parsing on tagged data in RFC822-like formats with special header formats. | You may override this method in order to use Message parsing on tagged data in RFC 2822-like formats with special header formats. | def isheader(self, line): """Determine whether a given line is a legal header. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
"""Determine whether a line is a legal end of RFC-822 headers. You may override this method if your application wants to bend the rules, e.g. to strip trailing whitespace, or to recognize MH template separators ('--------'). For convenience (e.g. for code reading from sockets) a line consisting of \r\n also matches. | """Determine whether a line is a legal end of RFC 2822 headers. You may override this method if your application wants to bend the rules, e.g. to strip trailing whitespace, or to recognize MH template separators ('--------'). For convenience (e.g. for code reading from sockets) a line consisting of \r\n also matches. | def islast(self, line): """Determine whether a line is a legal end of RFC-822 headers. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
You may override this method in order to use Message parsing on tagged data in RFC822-like formats that support embedded comments or free-text data. | You may override this method in order to use Message parsing on tagged data in RFC 2822-like formats that support embedded comments or free-text data. | def iscomment(self, line): """Determine whether a line should be skipped entirely. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
Look through the list of headers and find all lines matching a given header name (and their continuation lines). A list of the lines is returned, without interpretation. If the header does not occur, an empty list is returned. If the header occurs multiple times, all occurrences are returned. Case is not important in the header name. | Look through the list of headers and find all lines matching a given header name (and their continuation lines). A list of the lines is returned, without interpretation. If the header does not occur, an empty list is returned. If the header occurs multiple times, all occurrences are returned. Case is not important in the header name. | def getallmatchingheaders(self, name): """Find all header lines matching a given header name. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
This is similar to getallmatchingheaders, but it returns only the first matching header (and its continuation lines). | This is similar to getallmatchingheaders, but it returns only the first matching header (and its continuation lines). | def getfirstmatchingheader(self, name): """Get the first header line matching name. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
Return a string containing the literal text of the header but with the keyword stripped. All leading, trailing and embedded whitespace is kept in the string, however. Return None if the header does not occur. | Return a string containing the literal text of the header but with the keyword stripped. All leading, trailing and embedded whitespace is kept in the string, however. Return None if the header does not occur. | def getrawheader(self, name): """A higher-level interface to getfirstmatchingheader(). | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
This is the normal interface: it returns a stripped version of the header value for a given header name, or None if it doesn't exist. This uses the dictionary version which finds the *last* such header. | This is the normal interface: it returns a stripped version of the header value for a given header name, or None if it doesn't exist. This uses the dictionary version which finds the *last* such header. | def getheader(self, name, default=None): """Get the header value for a name. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
This returns a list of values for headers given more than once; each value in the result list is stripped in the same way as the result of getheader(). If the header is not given, return an empty list. | This returns a list of values for headers given more than once; each value in the result list is stripped in the same way as the result of getheader(). If the header is not given, return an empty list. | def getheaders(self, name): """Get all values for a header. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
def getaddrlist(self, name): """Get a list of addresses from a header. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
||
Retrieves a date field from the named header, returning a tuple compatible with time.mktime(). | Retrieves a date field from the named header, returning a tuple compatible with time.mktime(). | def getdate(self, name): """Retrieve a date field from a header. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
The first 9 elements make up a tuple compatible with time.mktime(), and the 10th is the offset of the poster's time zone from GMT/UTC. | The first 9 elements make up a tuple compatible with time.mktime(), and the 10th is the offset of the poster's time zone from GMT/UTC. | def getdate_tz(self, name): """Retrieve a date field from a header as a 10-tuple. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
Note: This is not a perfect inversion of __getitem__, because any changed headers get stuck at the end of the raw-headers list rather than where the altered header was. | Note: This is not a perfect inversion of __getitem__, because any changed headers get stuck at the end of the raw-headers list rather than where the altered header was. | def __setitem__(self, name, value): """Set the value of a header. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
RFC-822 in front of you. | RFC 2822 in front of you. http://www.faqs.org/rfcs/rfc2822.html | def parseaddr(address): """Parse an address into a (realname, mailaddr) tuple.""" a = AddrlistClass(address) list = a.getaddrlist() if not list: return (None, None) else: return list[0] | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
`field' is an unparsed address header field, containing one or more addresses. | `field' is an unparsed address header field, containing one or more addresses. | def __init__(self, field): """Initialize a new instance. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
"""Parse an RFC-822 addr-spec.""" | """Parse an RFC 2822 addr-spec.""" | def getaddrspec(self): """Parse an RFC-822 addr-spec.""" aslist = [] | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
`beginchar' is the start character for the fragment. If self is not looking at an instance of `beginchar' then getdelimited returns the empty string. | `beginchar' is the start character for the fragment. If self is not looking at an instance of `beginchar' then getdelimited returns the empty string. | def getdelimited(self, beginchar, endchars, allowcomments = 1): """Parse a header fragment delimited by special characters. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
If `allowcomments' is non-zero, embedded RFC-822 comments are allowed within the parsed fragment. | If `allowcomments' is non-zero, embedded RFC 2822 comments are allowed within the parsed fragment. | def getdelimited(self, beginchar, endchars, allowcomments = 1): """Parse a header fragment delimited by special characters. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
"""Parse an RFC-822 domain-literal.""" | """Parse an RFC 2822 domain-literal.""" | def getdomainliteral(self): """Parse an RFC-822 domain-literal.""" return '[%s]' % self.getdelimited('[', ']\r', 0) | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
def getatom(self): """Parse an RFC-822 atom.""" | def getatom(self, atomends=None): """Parse an RFC 2822 atom. Optional atomends specifies a different set of end token delimiters (the default is to use self.atomends). This is used e.g. in getphraselist() since phrase endings must not include the `.' (which is legal in phrases).""" | def getatom(self): """Parse an RFC-822 atom.""" atomlist = [''] | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
if self.field[self.pos] in self.atomends: | if self.field[self.pos] in atomends: | def getatom(self): """Parse an RFC-822 atom.""" atomlist = [''] | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
"""Parse a sequence of RFC-822 phrases. A phrase is a sequence of words, which are in turn either RFC-822 atoms or quoted-strings. Phrases are canonicalized by squeezing all runs of continuous whitespace into one space. | """Parse a sequence of RFC 2822 phrases. A phrase is a sequence of words, which are in turn either RFC 2822 atoms or quoted-strings. Phrases are canonicalized by squeezing all runs of continuous whitespace into one space. | def getphraselist(self): """Parse a sequence of RFC-822 phrases. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
elif self.field[self.pos] in self.atomends: | elif self.field[self.pos] in self.phraseends: | def getphraselist(self): """Parse a sequence of RFC-822 phrases. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
else: plist.append(self.getatom()) | else: plist.append(self.getatom(self.phraseends)) | def getphraselist(self): """Parse a sequence of RFC-822 phrases. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
"""An AddressList encapsulates a list of parsed RFC822 addresses.""" | """An AddressList encapsulates a list of parsed RFC 2822 addresses.""" | def getphraselist(self): """Parse a sequence of RFC-822 phrases. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py |
def test_main(): # Historically, these tests have sloppy about removing TESTFN. So get # rid of it no matter what. try: run_unittest(AutoFileTests, OtherFileTests) finally: if os.path.exists(TESTFN): os.unlink(TESTFN) | db3db6f0195946f7afb7c97dd9eacf8aed8c6c02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/db3db6f0195946f7afb7c97dd9eacf8aed8c6c02/test_file.py |
||
xover_lines.append(elem[0], elem[1], elem[2], elem[3], elem[4], elem[5:-2], elem[-2], elem[-1]) | xover_lines.append((elem[0], elem[1], elem[2], elem[3], elem[4], string.split(elem[5]), elem[6], elem[7])) | def xover(self,start,end): resp, lines = self.longcmd('XOVER ' + start + '-' + end) xover_lines = [] for line in lines: elem = string.splitfields(line,"\t") try: xover_lines.append(elem[0], elem[1], elem[2], elem[3], elem[4], elem[5:-2], elem[-2], elem[-1]) except IndexError: raise error_data,line return resp,xover_lines | 5774d96cd45821221b27fbea42a995a062bdff03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5774d96cd45821221b27fbea42a995a062bdff03/nntplib.py |
if sys.platform[:4] != 'java': int(testme) long(testme) float(testme) oct(testme) hex(testme) else: print "__int__: ()" print "__long__: ()" print "__float__: ()" print "__oct__: ()" print "__hex__: ()" | int(testme) long(testme) float(testme) oct(testme) hex(testme) | def __%(method)s__(self, *args): print "__%(method)s__:", args | 2ce1c848fa14ee9fbc8ef58e726a6594c9843a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ce1c848fa14ee9fbc8ef58e726a6594c9843a0a/test_class.py |
try: hash(C1()) except TypeError: pass else: raise TestFailed, "hash(C1()) should raise an exception" | check_exc("hash(C1())", TypeError) | def __cmp__(self, other): return 0 | 2ce1c848fa14ee9fbc8ef58e726a6594c9843a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ce1c848fa14ee9fbc8ef58e726a6594c9843a0a/test_class.py |
try: hash(C2()) except TypeError: pass else: raise TestFailed, "hash(C2()) should raise an exception" | check_exc("hash(C2())", TypeError) | def __eq__(self, other): return 1 | 2ce1c848fa14ee9fbc8ef58e726a6594c9843a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2ce1c848fa14ee9fbc8ef58e726a6594c9843a0a/test_class.py |
Returns a file object; the name of the file is accessible as file.name. The file will be automatically deleted when it is closed. | Returns an object with a file-like interface; the name of the file is accessible as file.name. The file will be automatically deleted when it is closed. | def NamedTemporaryFile(mode='w+b', bufsize=-1, suffix="", prefix=template, dir=None): """Create and return a temporary file. Arguments: 'prefix', 'suffix', 'dir' -- as for mkstemp. 'mode' -- the mode argument to os.fdopen (default "w+b"). 'bufsize' -- the buffer size argument to os.fdopen (default -1). The file is created as mkstemp() would do it. Returns a file object; the name of the file is accessible as file.name. The file will be automatically deleted when it is closed. """ if dir is None: dir = gettempdir() if 'b' in mode: flags = _bin_openflags else: flags = _text_openflags # Setting O_TEMPORARY in the flags causes the OS to delete # the file when it is closed. This is only supported by Windows. if _os.name == 'nt': flags |= _os.O_TEMPORARY (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags) file = _os.fdopen(fd, mode, bufsize) return _TemporaryFileWrapper(file, name) | 4e47ef78b80be2514bd34e1564974be43c648fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e47ef78b80be2514bd34e1564974be43c648fb8/tempfile.py |
Returns a file object. The file has no name, and will cease to exist when it is closed. | Returns an object with a file-like interface. The file has no name, and will cease to exist when it is closed. | def TemporaryFile(mode='w+b', bufsize=-1, suffix="", prefix=template, dir=None): """Create and return a temporary file. Arguments: 'prefix', 'suffix', 'directory' -- as for mkstemp. 'mode' -- the mode argument to os.fdopen (default "w+b"). 'bufsize' -- the buffer size argument to os.fdopen (default -1). The file is created as mkstemp() would do it. | 4e47ef78b80be2514bd34e1564974be43c648fb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e47ef78b80be2514bd34e1564974be43c648fb8/tempfile.py |
cur = self._make_iter_cursor() | try: cur = self._make_iter_cursor() except AttributeError: return | def iteritems(self): try: cur = self._make_iter_cursor() | c6c640fad08ee83a20e593f572c09b83a0cdf273 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c6c640fad08ee83a20e593f572c09b83a0cdf273/__init__.py |
if not self._dict['Download-URL']: return "%s: This package needs to be installed manually (no Download-URL field)" % _fmtpackagename(self) | if not self._dict.get('Download-URL'): return "%s: This package needs to be installed manually (no Download-URL field)" % self.fullname() | def installSinglePackage(self, output=None): """Download, unpack and install a single package. If output is given it should be a file-like object and it will receive a log of what happened.""" if not self._dict['Download-URL']: return "%s: This package needs to be installed manually (no Download-URL field)" % _fmtpackagename(self) msg = self.downloadPackageOnly(output) if msg: return "%s: download: %s" % (self.fullname(), msg) msg = self.unpackPackageOnly(output) if msg: return "%s: unpack: %s" % (self.fullname(), msg) return self.installPackageOnly(output) | 1e75044c4b14d159242e46b403f3c6087257a529 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1e75044c4b14d159242e46b403f3c6087257a529/pimp.py |
simple_err(struct.calcsize, 'Q') | simple_err(struct.calcsize, 'Z') | def simple_err(func, *args): try: apply(func, args) except struct.error: pass else: raise TestFailed, "%s%s did not raise struct.error" % ( func.__name__, args) | 80710d397150a83940730ebcf1f1dbdedac68d08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80710d397150a83940730ebcf1f1dbdedac68d08/test_struct.py |
def badpack(fmt, arg, got, exp): return def badunpack(fmt, arg, got, exp): return "unpack(%s, %s) -> (%s,) `fmt`, `arg`, `got`, `exp`) isbigendian = struct.pack('=h', 1) == '\0\1' | isbigendian = struct.pack('=i', 1)[0] == chr(0) | def badpack(fmt, arg, got, exp): return | 80710d397150a83940730ebcf1f1dbdedac68d08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80710d397150a83940730ebcf1f1dbdedac68d08/test_struct.py |
exit = 'Use Cmd-Q to quit.' | eof = 'Cmd-Q' | def setquit(): """Define new built-ins 'quit' and 'exit'. These are simply strings that display a hint on how to exit. """ if os.sep == ':': exit = 'Use Cmd-Q to quit.' elif os.sep == '\\': exit = 'Use Ctrl-Z plus Return to exit.' else: exit = 'Use Ctrl-D (i.e. EOF) to exit.' __builtin__.quit = __builtin__.exit = exit | 5d7ff12ac1d7be92dad98c8106e8b22146e17a21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d7ff12ac1d7be92dad98c8106e8b22146e17a21/site.py |
exit = 'Use Ctrl-Z plus Return to exit.' | eof = 'Ctrl-Z plus Return' | def setquit(): """Define new built-ins 'quit' and 'exit'. These are simply strings that display a hint on how to exit. """ if os.sep == ':': exit = 'Use Cmd-Q to quit.' elif os.sep == '\\': exit = 'Use Ctrl-Z plus Return to exit.' else: exit = 'Use Ctrl-D (i.e. EOF) to exit.' __builtin__.quit = __builtin__.exit = exit | 5d7ff12ac1d7be92dad98c8106e8b22146e17a21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d7ff12ac1d7be92dad98c8106e8b22146e17a21/site.py |
exit = 'Use Ctrl-D (i.e. EOF) to exit.' __builtin__.quit = __builtin__.exit = exit | eof = 'Ctrl-D (i.e. EOF)' class Quitter(object): def __init__(self, name): self.name = name def __repr__(self): return 'Use %s() or %s to exit' % (self.name, eof) def __call__(self, code=None): raise SystemExit(code) __builtin__.quit = Quitter('quit') __builtin__.exit = Quitter('exit') | def setquit(): """Define new built-ins 'quit' and 'exit'. These are simply strings that display a hint on how to exit. """ if os.sep == ':': exit = 'Use Cmd-Q to quit.' elif os.sep == '\\': exit = 'Use Ctrl-Z plus Return to exit.' else: exit = 'Use Ctrl-D (i.e. EOF) to exit.' __builtin__.quit = __builtin__.exit = exit | 5d7ff12ac1d7be92dad98c8106e8b22146e17a21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5d7ff12ac1d7be92dad98c8106e8b22146e17a21/site.py |
def send(self, str): """Send `str' to the server.""" if self.sock is None: if self.auto_open: self.connect() else: raise NotConnected() | aa383669d580641a7e82fe7a5d917388098ff7b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aa383669d580641a7e82fe7a5d917388098ff7b8/httplib.py |
||
str = '%s %s %s\r\n' % (method, url, self._http_vsn_str) try: self.send(str) except socket.error, v: if v[0] != 32 or not self.auto_open: raise self.send(str) | str = '%s %s %s' % (method, url, self._http_vsn_str) self._output(str) | def putrequest(self, method, url, skip_host=0): """Send a request to the server. | aa383669d580641a7e82fe7a5d917388098ff7b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aa383669d580641a7e82fe7a5d917388098ff7b8/httplib.py |
str = '%s: %s\r\n' % (header, value) self.send(str) | str = '%s: %s' % (header, value) self._output(str) | def putheader(self, header, value): """Send a request header line to the server. | aa383669d580641a7e82fe7a5d917388098ff7b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aa383669d580641a7e82fe7a5d917388098ff7b8/httplib.py |
self.send('\r\n') | self._send_output() | def endheaders(self): """Indicate that the last header line has been sent to the server.""" | aa383669d580641a7e82fe7a5d917388098ff7b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aa383669d580641a7e82fe7a5d917388098ff7b8/httplib.py |
return | def test(): """Test this module. A hodge podge of tests collected here, because they have too many external dependencies for the regular test suite. """ import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.python.org' selector = '/' if args[0:]: host = args[0] if args[1:]: selector = args[1] h = HTTP() h.set_debuglevel(dl) h.connect(host) h.putrequest('GET', selector) h.endheaders() status, reason, headers = h.getreply() print 'status =', status print 'reason =', reason print "read", len(h.getfile().read()) print if headers: for header in headers.headers: print header.strip() print # minimal test that code to extract host from url works class HTTP11(HTTP): _http_vsn = 11 _http_vsn_str = 'HTTP/1.1' h = HTTP11('www.python.org') h.putrequest('GET', 'http://www.python.org/~jeremy/') h.endheaders() h.getreply() h.close() if hasattr(socket, 'ssl'): for host, selector in (('sourceforge.net', '/projects/python'), ('dbserv2.theopalgroup.com', '/mediumfile'), ('dbserv2.theopalgroup.com', '/smallfile'), ): print "https://%s%s" % (host, selector) hs = HTTPS() hs.connect(host) hs.putrequest('GET', selector) hs.endheaders() status, reason, headers = hs.getreply() print 'status =', status print 'reason =', reason print "read", len(hs.getfile().read()) print if headers: for header in headers.headers: print header.strip() print return # Test a buggy server -- returns garbled status line. # http://www.yahoo.com/promotions/mom_com97/supermom.html c = HTTPConnection("promotions.yahoo.com") c.set_debuglevel(1) c.connect() c.request("GET", "/promotions/mom_com97/supermom.html") r = c.getresponse() print r.status, r.version lines = r.read().split("\n") print "\n".join(lines[:5]) c = HTTPConnection("promotions.yahoo.com", strict=1) c.set_debuglevel(1) c.connect() c.request("GET", "/promotions/mom_com97/supermom.html") try: r = c.getresponse() except BadStatusLine, err: print "strict mode failed as expected" print err else: print "XXX strict mode should have failed" for strict in 0, 1: h = HTTP(strict=strict) h.connect("promotions.yahoo.com") h.putrequest('GET', "/promotions/mom_com97/supermom.html") h.endheaders() status, reason, headers = h.getreply() assert (strict and status == -1) or status == 200, (strict, status) | aa383669d580641a7e82fe7a5d917388098ff7b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aa383669d580641a7e82fe7a5d917388098ff7b8/httplib.py |
|
result.addError(self,self.__exc_info()) | result.addError(self,sys.exc_info()) | def __call__(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except: result.addError(self,self.__exc_info()) return | 99fb595cca41d33d36ab582c50081efd19939891 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/99fb595cca41d33d36ab582c50081efd19939891/unittest.py |
result.addFailure(self,self.__exc_info()) | result.addFailure(self,sys.exc_info()) | def __call__(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except: result.addError(self,self.__exc_info()) return | 99fb595cca41d33d36ab582c50081efd19939891 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/99fb595cca41d33d36ab582c50081efd19939891/unittest.py |
result.addError(self,self.__exc_info()) | result.addError(self,sys.exc_info()) | def __call__(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except: result.addError(self,self.__exc_info()) return | 99fb595cca41d33d36ab582c50081efd19939891 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/99fb595cca41d33d36ab582c50081efd19939891/unittest.py |
result.addError(self,self.__exc_info()) | result.addError(self,sys.exc_info()) | def __call__(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except: result.addError(self,self.__exc_info()) return | 99fb595cca41d33d36ab582c50081efd19939891 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/99fb595cca41d33d36ab582c50081efd19939891/unittest.py |
def __exc_info(self): """Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed. """ exctype, excvalue, tb = sys.exc_info() newtb = tb.tb_next if newtb is None: return (exctype, excvalue, tb) return (exctype, excvalue, newtb) | def __exc_info(self): """Return a version of sys.exc_info() with the traceback frame minimised; usually the top level of the traceback frame is not needed. """ exctype, excvalue, tb = sys.exc_info() newtb = tb.tb_next if newtb is None: return (exctype, excvalue, tb) return (exctype, excvalue, newtb) | 99fb595cca41d33d36ab582c50081efd19939891 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/99fb595cca41d33d36ab582c50081efd19939891/unittest.py |
|
module = __import__(parts) | parts_copy = parts[:] while parts_copy: try: module = __import__(string.join(parts_copy,'.')) break except ImportError: del parts_copy[-1] if not parts_copy: raise | def loadTestsFromName(self, name, module=None): parts = string.split(name, '.') if module is None: if not parts: raise ValueError, "incomplete test name: %s" % name else: module = __import__(parts) parts = parts[1:] obj = module for part in parts: obj = getattr(obj, part) | 99fb595cca41d33d36ab582c50081efd19939891 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/99fb595cca41d33d36ab582c50081efd19939891/unittest.py |
Usage: %(progName)s [options] [test[:(casename|prefix-)]] [...] | Usage: %(progName)s [options] [test] [...] | def run(self, test): "Run the given test case or test suite." result = self._makeResult() startTime = time.time() test(result) stopTime = time.time() timeTaken = float(stopTime - startTime) result.printErrors() self.stream.writeln(result.separator2) run = result.testsRun self.stream.writeln("Ran %d test%s in %.3fs" % (run, run == 1 and "" or "s", timeTaken)) self.stream.writeln() if not result.wasSuccessful(): self.stream.write("FAILED (") failed, errored = map(len, (result.failures, result.errors)) if failed: self.stream.write("failures=%d" % failed) if errored: if failed: self.stream.write(", ") self.stream.write("errors=%d" % errored) self.stream.writeln(")") else: self.stream.writeln("OK") return result | 99fb595cca41d33d36ab582c50081efd19939891 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/99fb595cca41d33d36ab582c50081efd19939891/unittest.py |
if item > self.len-1 or item < -self.len: raise IndexError if item < 0: item += self.len return strftime(self.format, (item,)*9).capitalize() | if isinstance(item, int): if item < 0: item += self.len if not 0 <= item < self.len: raise IndexError, "out of range" return strftime(self.format, (item,)*9).capitalize() elif isinstance(item, type(slice(0))): return [self[e] for e in range(self.len)].__getslice__(item.start, item.stop) | def __getitem__(self, item): if item > self.len-1 or item < -self.len: raise IndexError if item < 0: item += self.len return strftime(self.format, (item,)*9).capitalize() | bf4e6a291d9107ad7fa7d1a006a8988c980c33d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf4e6a291d9107ad7fa7d1a006a8988c980c33d2/calendar.py |
month_name = _localized_name('%B', 12) month_abbr = _localized_name('%b', 12) | month_name = _localized_name('%B', 13) month_abbr = _localized_name('%b', 13) | def __len__(self): return self.len | bf4e6a291d9107ad7fa7d1a006a8988c980c33d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf4e6a291d9107ad7fa7d1a006a8988c980c33d2/calendar.py |
def __init__ (self, verbose=0, dry_run=0, force=0): | 11b3a6bf462f6f71f82b49e533ac03e7b26e2227 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11b3a6bf462f6f71f82b49e533ac03e7b26e2227/cygwinccompiler.py |
||
linker_so=('%s -mcygwin -mdll' % self.linker_dll)) | linker_so=('%s -mcygwin %s' % (self.linker_dll, shared_option))) | def __init__ (self, verbose=0, dry_run=0, force=0): | 11b3a6bf462f6f71f82b49e533ac03e7b26e2227 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11b3a6bf462f6f71f82b49e533ac03e7b26e2227/cygwinccompiler.py |
linker_so='%s -mno-cygwin -mdll %s' % (self.linker_dll, entry_point)) | linker_so='%s -mno-cygwin %s %s' % (self.linker_dll, shared_option, entry_point)) | def __init__ (self, verbose=0, dry_run=0, force=0): | 11b3a6bf462f6f71f82b49e533ac03e7b26e2227 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11b3a6bf462f6f71f82b49e533ac03e7b26e2227/cygwinccompiler.py |
r = gl.getgdesc(GL.GD_BITS_NORM_SNG_RED) g = gl.getgdesc(GL.GD_BITS_NORM_SNG_GREEN) b = gl.getgdesc(GL.GD_BITS_NORM_SNG_BLUE) if (r, g, b) <> (3, 3, 2): raise Error, 'Sorry, can only grab rgb8 on 8-bit Indigo' | if not is_entry_indigo(): raise Error, 'Sorry, can only grab rgb8 on entry level Indigo' | def grab_rgb8(w, h, pf): if gl.getdisplaymode() <> DMRGB: raise Error, 'Sorry, can only grab rgb8 in single-buf rgbmode' if pf <> 1 and pf <> 0: raise Error, 'Sorry, can only grab rgb8 with packfactor 1' r = gl.getgdesc(GL.GD_BITS_NORM_SNG_RED) g = gl.getgdesc(GL.GD_BITS_NORM_SNG_GREEN) b = gl.getgdesc(GL.GD_BITS_NORM_SNG_BLUE) if (r, g, b) <> (3, 3, 2): raise Error, 'Sorry, can only grab rgb8 on 8-bit Indigo' # XXX Dirty Dirty here. # XXX Set buffer to cmap mode, grab image and set it back. # XXX (Shouldn't be necessary???) gl.cmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 8) data = gl.lrectread(0, 0, w-1, h-1) data = data[:w*h] # BUG FIX for python lrectread gl.RGBmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 32) return data, None | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
def grab_rgb8(w, h, pf): if gl.getdisplaymode() <> DMRGB: raise Error, 'Sorry, can only grab rgb8 in single-buf rgbmode' if pf <> 1 and pf <> 0: raise Error, 'Sorry, can only grab rgb8 with packfactor 1' r = gl.getgdesc(GL.GD_BITS_NORM_SNG_RED) g = gl.getgdesc(GL.GD_BITS_NORM_SNG_GREEN) b = gl.getgdesc(GL.GD_BITS_NORM_SNG_BLUE) if (r, g, b) <> (3, 3, 2): raise Error, 'Sorry, can only grab rgb8 on 8-bit Indigo' # XXX Dirty Dirty here. # XXX Set buffer to cmap mode, grab image and set it back. # XXX (Shouldn't be necessary???) gl.cmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 8) data = gl.lrectread(0, 0, w-1, h-1) data = data[:w*h] # BUG FIX for python lrectread gl.RGBmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 32) return data, None | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
||
def printinfo(self): print 'Format: ', self.format print 'Size: ', self.width, 'x', self.height print 'Pack: ', self.packfactor, '; chrom:', self.chrompack print 'Bits: ', self.c0bits, self.c1bits, self.c2bits print 'Offset: ', self.offset | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
||
self.colormapinited = 1 | def initcolormap(self): if self.format == 'rgb': gl.RGBmode() gl.gconfig() self.colormapinited = 1 gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return gl.cmode() gl.gconfig() self.skipchrom = 0 if self.offset == 0: self.mask = 0x7ff else: self.mask = 0xfff if not self.quiet: sys.stderr.write('Initializing color map...') self._initcmap() self.colormapinited = 1 self.clear() if not self.quiet: sys.stderr.write(' Done.\n') | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
|
self.colormapinited = 1 self.clear() | gl.clear() | def initcolormap(self): if self.format == 'rgb': gl.RGBmode() gl.gconfig() self.colormapinited = 1 gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return gl.cmode() gl.gconfig() self.skipchrom = 0 if self.offset == 0: self.mask = 0x7ff else: self.mask = 0xfff if not self.quiet: sys.stderr.write('Initializing color map...') self._initcmap() self.colormapinited = 1 self.clear() if not self.quiet: sys.stderr.write(' Done.\n') | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
def initcolormap(self): if self.format == 'rgb': gl.RGBmode() gl.gconfig() self.colormapinited = 1 gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return gl.cmode() gl.gconfig() self.skipchrom = 0 if self.offset == 0: self.mask = 0x7ff else: self.mask = 0xfff if not self.quiet: sys.stderr.write('Initializing color map...') self._initcmap() self.colormapinited = 1 self.clear() if not self.quiet: sys.stderr.write(' Done.\n') | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
||
if self.offset == 0: gl.color(0x800) | if gl.getdisplaymode() in (DMRGB, DMRGBDOUBLE): gl.RGBcolor(200, 200, 200) | def clear(self): if not self.colormapinited: raise CallError if self.offset == 0: gl.color(0x800) gl.clear() else: gl.clear() | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
else: | return gl.writemask(0xffffffff) gl.clear() def clearto(self, r, g, b): if not self.colormapinited: raise CallError if gl.getdisplaymode() in (DMRGB, DMRGBDOUBLE): gl.RGBcolor(r, g, b) | def clear(self): if not self.colormapinited: raise CallError if self.offset == 0: gl.color(0x800) gl.clear() else: gl.clear() | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
return index = self.color0[0] self.fixcolor0 = 1 gl.mapcolor(index, r, g, b) gl.writemask(0xffffffff) gl.clear() gl.gflush() | def clear(self): if not self.colormapinited: raise CallError if self.offset == 0: gl.color(0x800) gl.clear() else: gl.clear() | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
|
c0bits, c1bits, c2bits = self.c0bits, self.c1bits, self.c2bits | c0bits = self.c0bits c1bits = self.c1bits c2bits = self.c2bits | def _initcmap(self): convcolor = choose_conversion(self.format) maxbits = gl.getgdesc(GL.GD_BITS_NORM_SNG_CMODE) if maxbits > 11: maxbits = 11 c0bits, c1bits, c2bits = self.c0bits, self.c1bits, self.c2bits if c0bits+c1bits+c2bits > maxbits: if self.fallback and c0bits < maxbits: # Cannot display frames in this mode, use grey self.skipchrom = 1 c1bits = c2bits = 0 convcolor = choose_conversion('grey') else: raise Error, 'Sorry, '+`maxbits`+ \ ' bits max on this machine' maxc0 = 1 << c0bits maxc1 = 1 << c1bits maxc2 = 1 << c2bits if self.offset == 0 and maxbits == 11: offset = 2048 else: offset = self.offset if maxbits <> 11: offset = offset & ((1<<maxbits)-1) # XXX why is this here? # for i in range(512, MAXMAP): # gl.mapcolor(i, 0, 0, 0) # gl.gflush() for c0 in range(maxc0): c0v = c0/float(maxc0-1) for c1 in range(maxc1): if maxc1 == 1: c1v = 0 else: c1v = c1/float(maxc1-1) for c2 in range(maxc2): if maxc2 == 1: c2v = 0 else: c2v = c2/float(maxc2-1) index = offset + c0 + (c1<<c0bits) + \ (c2 << (c0bits+c1bits)) if index < MAXMAP: rv, gv, bv = \ convcolor(c0v, c1v, c2v) r, g, b = int(rv*255.0), \ int(gv*255.0), \ int(bv*255.0) gl.mapcolor(index, r, g, b) gl.gflush() # send the colormap changes to the X server | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
self.color0 = None self.fixcolor0 = 0 | def _initcmap(self): convcolor = choose_conversion(self.format) maxbits = gl.getgdesc(GL.GD_BITS_NORM_SNG_CMODE) if maxbits > 11: maxbits = 11 c0bits, c1bits, c2bits = self.c0bits, self.c1bits, self.c2bits if c0bits+c1bits+c2bits > maxbits: if self.fallback and c0bits < maxbits: # Cannot display frames in this mode, use grey self.skipchrom = 1 c1bits = c2bits = 0 convcolor = choose_conversion('grey') else: raise Error, 'Sorry, '+`maxbits`+ \ ' bits max on this machine' maxc0 = 1 << c0bits maxc1 = 1 << c1bits maxc2 = 1 << c2bits if self.offset == 0 and maxbits == 11: offset = 2048 else: offset = self.offset if maxbits <> 11: offset = offset & ((1<<maxbits)-1) # XXX why is this here? # for i in range(512, MAXMAP): # gl.mapcolor(i, 0, 0, 0) # gl.gflush() for c0 in range(maxc0): c0v = c0/float(maxc0-1) for c1 in range(maxc1): if maxc1 == 1: c1v = 0 else: c1v = c1/float(maxc1-1) for c2 in range(maxc2): if maxc2 == 1: c2v = 0 else: c2v = c2/float(maxc2-1) index = offset + c0 + (c1<<c0bits) + \ (c2 << (c0bits+c1bits)) if index < MAXMAP: rv, gv, bv = \ convcolor(c0v, c1v, c2v) r, g, b = int(rv*255.0), \ int(gv*255.0), \ int(bv*255.0) gl.mapcolor(index, r, g, b) gl.gflush() # send the colormap changes to the X server | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
|
pass | print '[BasicVinFile.warmcache() not implemented]' | def warmcache(self): pass | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
if len(data) < ds: raise EOFError | if len(data) < ds: self.eofseen = 1 raise EOFError | def getnextframedata(self, ds, cs): if self.atframeheader: raise CallError if ds: data = self.fp.read(ds) if len(data) < ds: raise EOFError else: data = '' if cs: cdata = self.fp.read(cs) if len(cdata) < cs: raise EOFerror else: cdata = '' self.atframeheader = 1 self.framecount = self.framecount + 1 return (data, cdata) | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
if len(cdata) < cs: raise EOFerror | if len(cdata) < cs: self.eofseen = 1 raise EOFError | def getnextframedata(self, ds, cs): if self.atframeheader: raise CallError if ds: data = self.fp.read(ds) if len(data) < ds: raise EOFError else: data = '' if cs: cdata = self.fp.read(cs) if len(cdata) < cs: raise EOFerror else: cdata = '' self.atframeheader = 1 self.framecount = self.framecount + 1 return (data, cdata) | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
self.version = 3.0 | self.version = 3.0 | def initfp(self, fp, filename): self = VideoParams.init(self) self.fp = fp self.filename = filename self.version = 3.0 # In case anyone inquires self.headerwritten = 0 return self | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
self.fp.write(`(t, ds, cs)` + '\n') | data = `(t, ds, cs)` n = len(data) if n < 63: data = data + ' '*(63-n) self.fp.write(data + '\n') | def writeframeheader(self, t, ds, cs): if not self.headerwritten: self.writeheader() if not self.atheader: raise CallError self.fp.write(`(t, ds, cs)` + '\n') self.atheader = 0 | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
class VinFile(BasicVinFile, Displayer): | class VinFile(RandomVinFile, Displayer): | def writeframedata(self, data, cdata): if not self.headerwritten or self.atheader: raise CallError if data: self.fp.write(data) if cdata: self.fp.write(cdata) self.atheader = 1 self.framecount = self.framecount + 1 | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
return BasicVinFile.initfp(self, fp, filename) | return RandomVinFile.initfp(self, fp, filename) | def initfp(self, fp, filename): self = Displayer.init(self) return BasicVinFile.initfp(self, fp, filename) | d55ad5764ff5f1d547024090a1d01c463d5b18ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d55ad5764ff5f1d547024090a1d01c463d5b18ec/VFile.py |
badargs = 10, 10L, 34.5, "abc", {}, [], () for badarg in badargs: | for badarg in OTHERSTUFF: | def test_compare(self): t1 = timedelta(2, 3, 4) t2 = timedelta(2, 3, 4) self.failUnless(t1 == t2) self.failUnless(t1 <= t2) self.failUnless(t1 >= t2) self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) self.assertEqual(cmp(t1, t2), 0) self.assertEqual(cmp(t2, t1), 0) | 678586107d2b3cc57d84448d1a82b86cae4ecd9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/678586107d2b3cc57d84448d1a82b86cae4ecd9c/test_datetime.py |
for badarg in badargs: | def test_compare(self): t1 = timedelta(2, 3, 4) t2 = timedelta(2, 3, 4) self.failUnless(t1 == t2) self.failUnless(t1 <= t2) self.failUnless(t1 >= t2) self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) self.assertEqual(cmp(t1, t2), 0) self.assertEqual(cmp(t2, t1), 0) | 678586107d2b3cc57d84448d1a82b86cae4ecd9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/678586107d2b3cc57d84448d1a82b86cae4ecd9c/test_datetime.py |
|
badargs = 10, 10L, 34.5, "abc", {}, [], () for badarg in badargs: | for badarg in OTHERSTUFF: | def test_compare(self): t1 = self.theclass(2, 3, 4) t2 = self.theclass(2, 3, 4) self.failUnless(t1 == t2) self.failUnless(t1 <= t2) self.failUnless(t1 >= t2) self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) self.assertEqual(cmp(t1, t2), 0) self.assertEqual(cmp(t2, t1), 0) | 678586107d2b3cc57d84448d1a82b86cae4ecd9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/678586107d2b3cc57d84448d1a82b86cae4ecd9c/test_datetime.py |
for badarg in badargs: | def test_compare(self): t1 = self.theclass(2, 3, 4) t2 = self.theclass(2, 3, 4) self.failUnless(t1 == t2) self.failUnless(t1 <= t2) self.failUnless(t1 >= t2) self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) self.assertEqual(cmp(t1, t2), 0) self.assertEqual(cmp(t2, t1), 0) | 678586107d2b3cc57d84448d1a82b86cae4ecd9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/678586107d2b3cc57d84448d1a82b86cae4ecd9c/test_datetime.py |
|
badargs = (10, 10L, 34.5, "abc", {}, [], ()) if CMP_BUG_FIXED: badargs += (date(1, 1, 1), datetime(1, 1, 1, 1, 1), timedelta(9)) for badarg in badargs: | for badarg in OTHERSTUFF: | def test_comparing(self): args = [1, 2, 3, 4] t1 = self.theclass(*args) t2 = self.theclass(*args) self.failUnless(t1 == t2) self.failUnless(t1 <= t2) self.failUnless(t1 >= t2) self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) self.assertEqual(cmp(t1, t2), 0) self.assertEqual(cmp(t2, t1), 0) | 678586107d2b3cc57d84448d1a82b86cae4ecd9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/678586107d2b3cc57d84448d1a82b86cae4ecd9c/test_datetime.py |
for badarg in badargs: | def test_comparing(self): args = [1, 2, 3, 4] t1 = self.theclass(*args) t2 = self.theclass(*args) self.failUnless(t1 == t2) self.failUnless(t1 <= t2) self.failUnless(t1 >= t2) self.failUnless(not t1 != t2) self.failUnless(not t1 < t2) self.failUnless(not t1 > t2) self.assertEqual(cmp(t1, t2), 0) self.assertEqual(cmp(t2, t1), 0) | 678586107d2b3cc57d84448d1a82b86cae4ecd9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/678586107d2b3cc57d84448d1a82b86cae4ecd9c/test_datetime.py |
|
if CMP_BUG_FIXED: t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) | t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) | def test_mixed_compare(self): t1 = time(1, 2, 3) t2 = time(1, 2, 3) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=None) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=FixedOffset(None, "")) self.assertEqual(t1, t2) if CMP_BUG_FIXED: t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) | 678586107d2b3cc57d84448d1a82b86cae4ecd9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/678586107d2b3cc57d84448d1a82b86cae4ecd9c/test_datetime.py |
if CMP_BUG_FIXED: t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) | t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) | def test_mixed_compare(self): t1 = datetime(1, 2, 3, 4, 5, 6, 7) t2 = datetime(1, 2, 3, 4, 5, 6, 7) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=None) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=FixedOffset(None, "")) self.assertEqual(t1, t2) if CMP_BUG_FIXED: t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) | 678586107d2b3cc57d84448d1a82b86cae4ecd9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/678586107d2b3cc57d84448d1a82b86cae4ecd9c/test_datetime.py |
except (AttributeError, Tkinter.TclError): | except (KeyboardInterrupt, SystemExit): raise except Exception: | def __del__(self): try: if self.delete_font: self._call("font", "delete", self.name) except (AttributeError, Tkinter.TclError): pass | 22a5762e65613569ec0e052ca2bc2c1a5ec48f6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/22a5762e65613569ec0e052ca2bc2c1a5ec48f6c/tkFont.py |
def _handle_long_word(self, chunks, cur_line, cur_len, width): | def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width): | def _handle_long_word(self, chunks, cur_line, cur_len, width): """_handle_long_word(chunks : [string], cur_line : [string], cur_len : int, width : int) | d6b1aef33b7c7d40bfb1081d307451a71781d2bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6b1aef33b7c7d40bfb1081d307451a71781d2bc/textwrap.py |
cur_line.append(chunks[0][0:space_left]) chunks[0] = chunks[0][space_left:] | cur_line.append(reversed_chunks[-1][:space_left]) reversed_chunks[-1] = reversed_chunks[-1][space_left:] | def _handle_long_word(self, chunks, cur_line, cur_len, width): """_handle_long_word(chunks : [string], cur_line : [string], cur_len : int, width : int) | d6b1aef33b7c7d40bfb1081d307451a71781d2bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6b1aef33b7c7d40bfb1081d307451a71781d2bc/textwrap.py |
cur_line.append(chunks.pop(0)) | cur_line.append(reversed_chunks.pop()) | def _handle_long_word(self, chunks, cur_line, cur_len, width): """_handle_long_word(chunks : [string], cur_line : [string], cur_len : int, width : int) | d6b1aef33b7c7d40bfb1081d307451a71781d2bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6b1aef33b7c7d40bfb1081d307451a71781d2bc/textwrap.py |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.