rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
'gmt+1300':'GMT+13','gmt-0100':'GMT-1','gmt-0200':'GMT-2', 'gmt-0300':'GMT-3','gmt-0400':'GMT-4','gmt-0500':'GMT-5', 'gmt-0600':'GMT-6','gmt-0700':'GMT-7','gmt-0800':'GMT-8', 'gmt-0900':'GMT-9','gmt-1000':'GMT-10','gmt-1100':'GMT-11', 'gmt-1200':'GMT-12','greenwich':'Greenwich','hongkong':'Hongkong',
'gmt+1300':'GMT+13', 'gmt-0100':'GMT-1', 'gmt-0200':'GMT-2', 'gmt-0300':'GMT-3', 'gmt-0400':'GMT-4', 'gmt-0500':'GMT-5', 'gmt-0600':'GMT-6', 'gmt-0700':'GMT-7', 'gmt-0800':'GMT-8', 'gmt-0900':'GMT-9', 'gmt-1000':'GMT-10','gmt-1100':'GMT-11','gmt-1200':'GMT-12', 'gmt+1': 'GMT+1', 'gmt+2': 'GMT+2', 'gmt+3': 'GMT+3', 'gm...
def info(self,t=None): idx=self.index(t)[0] zs =self.az[self.tinfo[idx][2]:] return self.tinfo[idx][0],self.tinfo[idx][1],zs[:find(zs,'\000')]
e3c3fc51844495761b2c4fd0f0464373800ac912 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e3c3fc51844495761b2c4fd0f0464373800ac912/DateTime.py
for k in data.keys(None, delete_end):
for k in list(data.keys(None, delete_end)):
def _housekeep(self, delete_end): """ do garbage collection, bucket replentishing and notification """ data = self._data period = self._period min_spares = self._min_spare_buckets DEBUG and TLOG( '_housekeep: current slice %s' % self._getCurrentTimeslice() ) notify = {} while 1: try: k, v = self.notify_queue.get_nowait...
39eb2dfe1dcd6ba650e5dd535456590a1494b1fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/39eb2dfe1dcd6ba650e5dd535456590a1494b1fc/Transience.py
mod_since=int(DateTime(header).timeTime())
mod_since=long(DateTime(header).timeTime())
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
e4741a0305b9212c6acc3b92f7f09b498843ce3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e4741a0305b9212c6acc3b92f7f09b498843ce3a/Image.py
last_mod = int(self._p_mtime)
last_mod = long(self._p_mtime)
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
e4741a0305b9212c6acc3b92f7f09b498843ce3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e4741a0305b9212c6acc3b92f7f09b498843ce3a/Image.py
last_mod = 0
last_mod = long(0)
def index_html(self, REQUEST, RESPONSE): """ The default view of the contents of a File or Image.
e4741a0305b9212c6acc3b92f7f09b498843ce3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e4741a0305b9212c6acc3b92f7f09b498843ce3a/Image.py
def _compare(dt1, dt2): '''Compares the internal representation of dt1 with the representation in dt2. Allows sub-millisecond variations. Primarily for testing.''' assert dt1.millis() == dt2.millis(), \ '%s != %s' % (dt1.millis(),dt2.millis()) assert math.floor(dt1._t * 1000.0) == \ math.floor(dt2._t * 1000.0) assert ...
def _compare(dt1, dt2): '''Compares the internal representation of dt1 with the representation in dt2. Allows sub-millisecond variations. Primarily for testing.''' assert dt1.millis() == dt2.millis(), \ '%s != %s' % (dt1.millis(),dt2.millis()) assert math.floor(dt1._t * 1000.0) == \ math.floor(dt2._t * 1000.0) assert ...
b3c9e0f18e86ee332fdce4466b2b7295d9ea9fd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3c9e0f18e86ee332fdce4466b2b7295d9ea9fd7/testDateTime.py
_compare(dt, dt1)
self.assertEqual(repr(dt),repr(dt1))
def testConstructor3(self): '''Constructor from date/time string''' dt = DateTime() dt1s = '%d/%d/%d %d:%d:%f %s' % ( dt.year(), dt.month(), dt.day(), dt.hour(), dt.minute(), dt.second(), dt.timezone()) dt1 = DateTime(dt1s) _compare(dt, dt1)
b3c9e0f18e86ee332fdce4466b2b7295d9ea9fd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3c9e0f18e86ee332fdce4466b2b7295d9ea9fd7/testDateTime.py
assert dt.debugCompare(dt1), (dt, dt1)
self._compare(dt,dt1)
def testConstructor4(self): '''Constructor from time float''' dt = DateTime() dt1 = DateTime(float(dt)) assert dt.debugCompare(dt1), (dt, dt1)
b3c9e0f18e86ee332fdce4466b2b7295d9ea9fd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3c9e0f18e86ee332fdce4466b2b7295d9ea9fd7/testDateTime.py
_compare(dt, dt1)
self._compare(dt, dt1)
def testConstructor6(self): '''Constructor from year and julian date''' # This test must normalize the time zone, or it *will* break when # DST changes! dt1 = DateTime(2000, 5.500000578705) dt = DateTime('2000/1/5 12:00:00.050 pm %s' % dt1.localZone()) _compare(dt, dt1)
b3c9e0f18e86ee332fdce4466b2b7295d9ea9fd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3c9e0f18e86ee332fdce4466b2b7295d9ea9fd7/testDateTime.py
assert dt.debugCompare(dt1), (dt, dt1)
self.assertEqual(repr(dt),repr(dt1))
def testConstructor7(self): '''Constructor from parts''' dt = DateTime() dt1 = DateTime( dt.year(), dt.month(), dt.day(), dt.hour(), dt.minute(), dt.second(), dt.timezone()) assert dt.debugCompare(dt1), (dt, dt1)
b3c9e0f18e86ee332fdce4466b2b7295d9ea9fd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3c9e0f18e86ee332fdce4466b2b7295d9ea9fd7/testDateTime.py
em=regex.compile("[ \t\n]\*\([^ \t][^\n*]*[^ \t]\)\*\([ \t\n,.:;!?]\)") code=regex.compile("[ \t\n(]'\([^ \t']\([^\n']*[^ \t']\)?\)'\([) \t\n,.:;!?]\)") strong=regex.compile("[ \t\n]\*\*\([^ \t][^\n*]*[^ \t]\)\*\*\([ \t\n,.:;!?]\)") extra_dl=regex.compile("</dl>\n<dl>") extra_ul=regex.compile("</ul>\n<ul>") extra_ol=r...
def structure(list): if not list: return [] i=0 l=len(list) r=[] while i < l: sublen=paragraphs(list,i) i=i+1 r.append((list[i-1][1],structure(list[i:i+sublen]))) i=i+sublen return r
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
s=regsub.gsub(strong,' <strong>\\1</strong>\\2',s) s=regsub.gsub(code,' <code>\\1</code>\\3',s) s=regsub.gsub(em,' <em>\\1</em>\\2',s)
s=gsub(strong,'\\1<strong>\\2</strong>\\3',s) s=gsub(code, '\\1<code>\\2</code>\\3',s) s=gsub(em, '\\1<em>\\2</em>\\3',s)
def ctag(s): if s is None: s='' s=regsub.gsub(strong,' <strong>\\1</strong>\\2',s) s=regsub.gsub(code,' <code>\\1</code>\\3',s) s=regsub.gsub(em,' <em>\\1</em>\\2',s) return s
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
def __str__(self):
def __str__(self, extra_dl=regex.compile("</dl>\n<dl>"), extra_ul=regex.compile("</ul>\n<ul>"), extra_ol=regex.compile("</ol>\n<ol>"), ):
def __str__(self):
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
s=regsub.gsub(extra_dl,'\n',s) s=regsub.gsub(extra_ul,'\n',s) s=regsub.gsub(extra_ol,'\n',s)
s=gsub(extra_dl,'\n',s) s=gsub(extra_ul,'\n',s) s=gsub(extra_ol,'\n',s)
def __str__(self):
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
elif nl.search(s[0]) < 0 and s[1]:
elif nl.search(s[0]) < 0 and s[1] and s[0][-1:] != ':':
def _str(self,structure,level):
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
r='<XMP>\n'
r='<PRE>\n'
def pre(self,structure,tagged=0):
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
r="%s%s\n\n%s" % (r,s[0],self.pre(s[1],1)) if not tagged: r=r+'</XMP>\n'
r="%s%s\n\n%s" % (r,html_quote(s[0]),self.pre(s[1],1)) if not tagged: r=r+'</PRE>\n'
def pre(self,structure,tagged=0):
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
import regsub text = regsub.gsub(
text = gsub(
def html_with_references(text): import regsub text = regsub.gsub( '[\0\n].. \[\([-_0-9_a-zA-Z]+\)\]', '\n <a name="\\1">[\\1]</a>', text) text = regsub.gsub( '\([\0- ,]\)\[\([0-9_a-zA-Z]+\)\]\([\0- ,.:]\)', '\\1<a href="#\\2">[\\2]</a>\\3', text) text = regsub.gsub( '\([\0- ]\)\([a-z]+://[^\0- ]+\)', '\\1<a href="\\...
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
text = regsub.gsub(
text = gsub(
def html_with_references(text): import regsub text = regsub.gsub( '[\0\n].. \[\([-_0-9_a-zA-Z]+\)\]', '\n <a name="\\1">[\\1]</a>', text) text = regsub.gsub( '\([\0- ,]\)\[\([0-9_a-zA-Z]+\)\]\([\0- ,.:]\)', '\\1<a href="#\\2">[\\2]</a>\\3', text) text = regsub.gsub( '\([\0- ]\)\([a-z]+://[^\0- ]+\)', '\\1<a href="\\...
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
text = regsub.gsub(
text = gsub(
def html_with_references(text): import regsub text = regsub.gsub( '[\0\n].. \[\([-_0-9_a-zA-Z]+\)\]', '\n <a name="\\1">[\\1]</a>', text) text = regsub.gsub( '\([\0- ,]\)\[\([0-9_a-zA-Z]+\)\]\([\0- ,.:]\)', '\\1<a href="#\\2">[\\2]</a>\\3', text) text = regsub.gsub( '\([\0- ]\)\([a-z]+://[^\0- ]+\)', '\\1<a href="\\...
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
print html_with_references(sys.stdin.read())
if '-t' in sys.argv: import regex, string s=sys.stdin.read() r=regex.compile('\([\0-\n]*\n\)') if r.match(s) >= 0: s=s[len(r.group(1)):] s=str(html_with_references(s)) if s[:4]=='<h1>': t=s[4:string.find(s,'</h1>')] s='''<html><head><title>%s</title> </head><body> %s </body></html> ''' % (t,s) print s else: print html...
def main(): import sys print html_with_references(sys.stdin.read())
4bf472476dd8f1951924bc51314fa330c37ae22f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4bf472476dd8f1951924bc51314fa330c37ae22f/StructuredText.py
def document_src(self, REQUEST, RESPONSE):
def document_src(self, REQUEST=None, RESPONSE=None):
def document_src(self, REQUEST, RESPONSE): """Return unprocessed document source.""" RESPONSE.setHeader('Content-Type', 'text/plain') return self.read()
eae6cbffdecdb3f753772e1cae01b3be7ac8f208 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/eae6cbffdecdb3f753772e1cae01b3be7ac8f208/DTMLMethod.py
RESPONSE.setHeader('Content-Type', 'text/plain')
if RESPONSE is not None: RESPONSE.setHeader('Content-Type', 'text/plain')
def document_src(self, REQUEST, RESPONSE): """Return unprocessed document source.""" RESPONSE.setHeader('Content-Type', 'text/plain') return self.read()
eae6cbffdecdb3f753772e1cae01b3be7ac8f208 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/eae6cbffdecdb3f753772e1cae01b3be7ac8f208/DTMLMethod.py
if mtime == self._v_last_read: return
if hasattr(self, '_v_program') and mtime == self._v_last_read: return
def _cook_check(self): if self._v_last_read and not DevelopmentMode: return __traceback_info__ = self.filename try: mtime=os.stat(self.filename)[8] except: mtime=0 if mtime == self._v_last_read: return self.pt_edit(open(self.filename), None) self._cook() if self._v_errors: LOG('PageTemplateFile', ERROR, 'Error in te...
832932e592c52ecc4122d37097e7f120d9007e17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/832932e592c52ecc4122d37097e7f120d9007e17/PageTemplateFile.py
if hasattr(self, idattr): id=getattr(self, idattr)
if hasattr(item, idattr): id=getattr(item, idattr)
def tpValuesIds(self, branches, args, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): # This should build the ids of subitems which are # expandable (non-empty). Leaves should never be # in the state - it will screw the colspan counting. r=[] idattr=args['id'] try: try: items=getattr(self, branches)() exce...
e04cc3d9225693282bb2a306ea5d4af2951b770e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e04cc3d9225693282bb2a306ea5d4af2951b770e/TreeTag.py
def set_cdata_mode(self):
cdata_endtag = None def set_cdata_mode(self, endtag=None): self.cdata_endtag = endtag
def set_cdata_mode(self): self.interesting = interesting_cdata
1c2de949e72b4ab0392a7aacbc8554a098df7be3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1c2de949e72b4ab0392a7aacbc8554a098df7be3/HTMLParser.py
self.set_cdata_mode()
self.set_cdata_mode(tag)
def parse_starttag(self, i): self.__starttag_text = None endpos = self.check_for_whole_start_tag(i) if endpos < 0: return endpos rawdata = self.rawdata self.__starttag_text = rawdata[i:endpos]
1c2de949e72b4ab0392a7aacbc8554a098df7be3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1c2de949e72b4ab0392a7aacbc8554a098df7be3/HTMLParser.py
tag = match.group(1) self.handle_endtag(tag.lower())
tag = match.group(1).lower() if ( self.cdata_endtag is not None and tag != self.cdata_endtag): self.handle_data(match.group(0)) else: self.handle_endtag(tag)
def parse_endtag(self, i): rawdata = self.rawdata assert rawdata[i:i+2] == "</", "unexpected call to parse_endtag" match = endendtag.search(rawdata, i+1) # > if not match: return -1 j = match.end() match = endtagfind.match(rawdata, i) # </ + tag + > if not match: self.error("bad end tag: %s" % `rawdata[i:j]`) tag = mat...
1c2de949e72b4ab0392a7aacbc8554a098df7be3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1c2de949e72b4ab0392a7aacbc8554a098df7be3/HTMLParser.py
result = pw_validate(passwrd, password) if not result: LOG('Zope', WARNING, 'invalid password for user %s' % self.getUserName())
result = pw_validate(passwrd, password)
def authenticate(self, password, request): passwrd=self._getPassword()
b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d/User.py
if domains and result: result = domainSpecMatch(domains, request) if not result: LOG('Zope', WARNING, 'invalid domain for user %s' % self.getUserName()) return result
if domains: return result and domainSpecMatch(domains, request)
def authenticate(self, password, request): passwrd=self._getPassword()
b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d/User.py
LOG('Zope', WARNING, 'non-basic authentication attempted')
def validate(self,request,auth='',roles=None):
b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d/User.py
LOG('Zope', WARNING, 'no such user as %s in %s' \ % (name, self.absolute_url()))
def validate(self,request,auth='',roles=None):
b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d/User.py
LOG('Zope', WARNING, 'user %s is not authorized to access %s' \ % (name, parent.absolute_url()))
def validate(self,request,auth='',roles=None):
b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d/User.py
LOG('Zope', WARNING, 'no such user as %s in %s' \ % (name, self.absolute_url()))
def validate(self,request,auth='',roles=None): parent=request['PARENTS'][0] e=request.environ if e.has_key('REMOTE_USER'): name=e['REMOTE_USER'] else: for ob in self.getUsers(): domains=ob.getDomains() if domains: if ob.authenticate('', request): if ob.allowed(parent, roles): ob=ob.__of__(self) return ob nobody=self._n...
b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d/User.py
LOG('Zope', WARNING, 'user %s is not authorized to access %s' \ % (name, parent.absolute_url()))
def validate(self,request,auth='',roles=None): parent=request['PARENTS'][0] e=request.environ if e.has_key('REMOTE_USER'): name=e['REMOTE_USER'] else: for ob in self.getUsers(): domains=ob.getDomains() if domains: if ob.authenticate('', request): if ob.allowed(parent, roles): ob=ob.__of__(self) return ob nobody=self._n...
b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b524eb8d385b3d37d4c9cdb4f50ab88b14c32c5d/User.py
<TABLE BORDER="0" WIDTH="100%"> <TR VALIGN="TOP"> <TD WIDTH="10%" ALIGN="CENTER">
<table border="0" width="100%"> <tr valign="top"> <td width="10%" align="center">
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960/HTTPResponse.py
</TD> <TD WIDTH="90%"> <H2>Site Error</H2> <P>An error was encountered while publishing this resource. </P>""" + \
</td> <td width="90%"> <h2>Site Error</h2> <p>An error was encountered while publishing this resource. </p>""" + \
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960/HTTPResponse.py
<P><STRONG>%s</STRONG></P>
<p><strong>%s</strong></p>
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960/HTTPResponse.py
<HR NOSHADE> <P>Troubleshooting Suggestions</P> <UL> <LI>The URL may be incorrect.</LI> <LI>The parameters passed to this resource may be incorrect.</LI> <LI>A resource that this resource relies on may be encountering an error.</LI> </UL> <P>For more detailed information about the error, please
<hr noshade="noshade"/> <p>Troubleshooting Suggestions</p> <ul> <li>The URL may be incorrect.</li> <li>The parameters passed to this resource may be incorrect.</li> <li>A resource that this resource relies on may be encountering an error.</li> </ul> <p>For more detailed information about the error, please
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960/HTTPResponse.py
</P> <P>If the error persists please contact the site maintainer.
</p> <p>If the error persists please contact the site maintainer.
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960/HTTPResponse.py
</P> </TD></TR> </TABLE>""")
</p> </td></tr> </table>""")
def _error_html(self,title,body): # XXX could this try to use standard_error_message somehow? return ("""\
8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8f3efd0a3aa3bb2f0aba1e6360ba06506a1b8960/HTTPResponse.py
def prepare(self, defaulthost=None, dnsresolver=None,
def prepare(self, defaulthost='', dnsresolver=None,
def prepare(self, defaulthost=None, dnsresolver=None, module=None, env=None, portbase=None): if defaulthost: hostname = defaulthost ip = socket.gethostbyname(hostname) elif defaulthost is '': hostname = '' ip = '127.0.0.1' else: hostname, ip = get_default_host_info() if not self.host: self._set_default_host(hostname, i...
da426df2ddc70179ef0e02400dd80023f54ce7e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da426df2ddc70179ef0e02400dd80023f54ce7e3/datatypes.py
if defaulthost: hostname = defaulthost ip = socket.gethostbyname(hostname) elif defaulthost is '': hostname = '' ip = '127.0.0.1' else: hostname, ip = get_default_host_info()
def prepare(self, defaulthost=None, dnsresolver=None, module=None, env=None, portbase=None): if defaulthost: hostname = defaulthost ip = socket.gethostbyname(hostname) elif defaulthost is '': hostname = '' ip = '127.0.0.1' else: hostname, ip = get_default_host_info() if not self.host: self._set_default_host(hostname, i...
da426df2ddc70179ef0e02400dd80023f54ce7e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da426df2ddc70179ef0e02400dd80023f54ce7e3/datatypes.py
self._set_default_host(hostname, ip)
ip = socket.gethostbyname(defaulthost) self._set_default_host(defaulthost, ip)
def prepare(self, defaulthost=None, dnsresolver=None, module=None, env=None, portbase=None): if defaulthost: hostname = defaulthost ip = socket.gethostbyname(hostname) elif defaulthost is '': hostname = '' ip = '127.0.0.1' else: hostname, ip = get_default_host_info() if not self.host: self._set_default_host(hostname, i...
da426df2ddc70179ef0e02400dd80023f54ce7e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da426df2ddc70179ef0e02400dd80023f54ce7e3/datatypes.py
server = HTTPServer.zhttp_server(ip=self.host, port=self.port,
server = HTTPServer.zhttp_server(ip=self.ip, port=self.port,
def create(self): from ZServer import HTTPServer from ZServer.AccessLogger import access_logger handler = self.createHandler() handler._force_connection_close = self.force_connection_close if self.webdav_source_clients: handler.set_webdav_source_clients(self.webdav_source_clients) server = HTTPServer.zhttp_server(ip=se...
da426df2ddc70179ef0e02400dd80023f54ce7e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da426df2ddc70179ef0e02400dd80023f54ce7e3/datatypes.py
return FTPServer(ip=self.host, hostname=self.host, port=self.port,
return FTPServer(ip=self.ip, hostname=self.host, port=self.port,
def create(self): from ZServer.AccessLogger import access_logger from ZServer.FTPServer import FTPServer return FTPServer(ip=self.host, hostname=self.host, port=self.port, module=self.module, resolver=self.dnsresolver, logger_object=access_logger)
da426df2ddc70179ef0e02400dd80023f54ce7e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da426df2ddc70179ef0e02400dd80023f54ce7e3/datatypes.py
return PCGIServer(ip=self.host, port=self.port,
return PCGIServer(ip=self.ip, port=self.port,
def create(self): from ZServer.AccessLogger import access_logger from ZServer.PCGIServer import PCGIServer return PCGIServer(ip=self.host, port=self.port, module=self.module, resolver=self.dnsresolver, pcgi_file=self.path, logger_object=access_logger)
da426df2ddc70179ef0e02400dd80023f54ce7e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da426df2ddc70179ef0e02400dd80023f54ce7e3/datatypes.py
return FCGIServer(ip=self.host, port=self.port,
return FCGIServer(ip=self.ip, port=self.port,
def create(self): from ZServer.AccessLogger import access_logger from ZServer.FCGIServer import FCGIServer return FCGIServer(ip=self.host, port=self.port, socket_file=self.path, module=self.module, resolver=self.dnsresolver, logger_object=access_logger)
da426df2ddc70179ef0e02400dd80023f54ce7e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/da426df2ddc70179ef0e02400dd80023f54ce7e3/datatypes.py
return map(lambda name: {
return map( lambda name: {
def tables(self,*args,**kw): if self.db is None: self.open() return map(lambda name: { 'TABLE_NAME': name, 'TABLE_TYPE': 'TABLE', }, self.db.table_names())
362e351b09b6c7e403e467c17467427f527069d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/362e351b09b6c7e403e467c17467427f527069d6/db.py
}, self.db.table_names())
}, filter(self.db.database.datadefs.has_key, self.db.table_names()) )
def tables(self,*args,**kw): if self.db is None: self.open() return map(lambda name: { 'TABLE_NAME': name, 'TABLE_TYPE': 'TABLE', }, self.db.table_names())
362e351b09b6c7e403e467c17467427f527069d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/362e351b09b6c7e403e467c17467427f527069d6/db.py
""" a slightly modified version of zope.tales.expressions.simpleTraverse() that interacts correctly with objects implementing bobo_traverse(). """
"""A slightly modified version of zope.tales.expressions.simpleTraverse that interacts correctly with objects requiring."""
def boboTraverseAwareSimpleTraverse(object, path_items, econtext): """ a slightly modified version of zope.tales.expressions.simpleTraverse() that interacts correctly with objects implementing bobo_traverse(). """ request = getattr(econtext, 'request', None) path_items = list(path_items) path_items.reverse() while pat...
8e4a601784ce508f184b2829883cce3f8aaaf74a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8e4a601784ce508f184b2829883cce3f8aaaf74a/Expressions.py
def boboTraverseAwareSimpleTraverse(object, path_items, econtext): """ a slightly modified version of zope.tales.expressions.simpleTraverse() that interacts correctly with objects implementing bobo_traverse(). """ request = getattr(econtext, 'request', None) path_items = list(path_items) path_items.reverse() while pat...
8e4a601784ce508f184b2829883cce3f8aaaf74a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8e4a601784ce508f184b2829883cce3f8aaaf74a/Expressions.py
def boboTraverseAwareSimpleTraverse(object, path_items, econtext): """ a slightly modified version of zope.tales.expressions.simpleTraverse() that interacts correctly with objects implementing bobo_traverse(). """ request = getattr(econtext, 'request', None) path_items = list(path_items) path_items.reverse() while pat...
8e4a601784ce508f184b2829883cce3f8aaaf74a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8e4a601784ce508f184b2829883cce3f8aaaf74a/Expressions.py
"""Zope2-aware path expression implementation"""
def boboTraverseAwareSimpleTraverse(object, path_items, econtext): """ a slightly modified version of zope.tales.expressions.simpleTraverse() that interacts correctly with objects implementing bobo_traverse(). """ request = getattr(econtext, 'request', None) path_items = list(path_items) path_items.reverse() while pat...
8e4a601784ce508f184b2829883cce3f8aaaf74a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8e4a601784ce508f184b2829883cce3f8aaaf74a/Expressions.py
def translate(self, msgid, domain, mapping=None, context=None, target_language=None, default=None): if context is None: context = self.contexts.get('context')
def translate(self, msgid, domain=None, mapping=None, default=None): context = self.contexts.get('context')
def translate(self, msgid, domain, mapping=None, context=None, target_language=None, default=None): if context is None: context = self.contexts.get('context') return getGlobalTranslationService().translate( domain, msgid, mapping=mapping, context=context, default=default, target_language=target_language)
8e4a601784ce508f184b2829883cce3f8aaaf74a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8e4a601784ce508f184b2829883cce3f8aaaf74a/Expressions.py
default=default, target_language=target_language)
default=default)
def translate(self, msgid, domain, mapping=None, context=None, target_language=None, default=None): if context is None: context = self.contexts.get('context') return getGlobalTranslationService().translate( domain, msgid, mapping=mapping, context=context, default=default, target_language=target_language)
8e4a601784ce508f184b2829883cce3f8aaaf74a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8e4a601784ce508f184b2829883cce3f8aaaf74a/Expressions.py
del self._unindex[i]
del self._unindex[documentId]
def unindex_object(self, documentId): """ Unindex the object with integer id 'documentId' and don't raise an exception if we fail """
3485811141b792ab96777979127630deb4af4d9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3485811141b792ab96777979127630deb4af4d9f/UnIndex.py
line = f.readline() while line != "------\n":
line = f.readline().strip() while line != "------":
def verifyEntry(self, f, time=None, subsys=None, severity=None, summary=None, detail=None, error=None): # skip to the beginning of next entry line = f.readline() while line != "------\n": if not line: self.fail("can't find entry in log file") line = f.readline() line = f.readline().strip() _time, rest = line.split(" "...
7fceae6b2fbb37aee25363c2bbd681b5f7ac06f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7fceae6b2fbb37aee25363c2bbd681b5f7ac06f4/testzLog.py
line = f.readline()
line = f.readline().strip()
def verifyEntry(self, f, time=None, subsys=None, severity=None, summary=None, detail=None, error=None): # skip to the beginning of next entry line = f.readline() while line != "------\n": if not line: self.fail("can't find entry in log file") line = f.readline() line = f.readline().strip() _time, rest = line.split(" "...
7fceae6b2fbb37aee25363c2bbd681b5f7ac06f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7fceae6b2fbb37aee25363c2bbd681b5f7ac06f4/testzLog.py
last = "%s: %s\n" % (error[0], error[1])
last = "%s: %s" % (error[0], error[1])
def verifyEntry(self, f, time=None, subsys=None, severity=None, summary=None, detail=None, error=None): # skip to the beginning of next entry line = f.readline() while line != "------\n": if not line: self.fail("can't find entry in log file") line = f.readline() line = f.readline().strip() _time, rest = line.split(" "...
7fceae6b2fbb37aee25363c2bbd681b5f7ac06f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7fceae6b2fbb37aee25363c2bbd681b5f7ac06f4/testzLog.py
line = f.readline()
line = f.readline().strip()
def verifyEntry(self, f, time=None, subsys=None, severity=None, summary=None, detail=None, error=None): # skip to the beginning of next entry line = f.readline() while line != "------\n": if not line: self.fail("can't find entry in log file") line = f.readline() line = f.readline().strip() _time, rest = line.split(" "...
7fceae6b2fbb37aee25363c2bbd681b5f7ac06f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7fceae6b2fbb37aee25363c2bbd681b5f7ac06f4/testzLog.py
if line == "------\n":
if line == "------":
def verifyEntry(self, f, time=None, subsys=None, severity=None, summary=None, detail=None, error=None): # skip to the beginning of next entry line = f.readline() while line != "------\n": if not line: self.fail("can't find entry in log file") line = f.readline() line = f.readline().strip() _time, rest = line.split(" "...
7fceae6b2fbb37aee25363c2bbd681b5f7ac06f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7fceae6b2fbb37aee25363c2bbd681b5f7ac06f4/testzLog.py
roles=parent.__roles__ if roles is None: return 'Anonymous', if 'Shared' in roles: roles=list(roles) roles.remove('Shared') r=r+roles else: try: return r+list(roles) except: return r
def _shared_roles(self, parent): r=[] while 1: if hasattr(parent, 'aq_parent'): while hasattr(parent.aq_self,'aq_self'): parent=parent.aq_self parent=parent.aq_parent else: return r roles=parent.__roles__ if roles is None: return 'Anonymous', if 'Shared' in roles: roles=list(roles) roles.remove('Shared') r=r+roles else...
df7e95abc89b922ddf2e5d0ec93df7d688affa94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/df7e95abc89b922ddf2e5d0ec93df7d688affa94/User.py
if 'Anonymous' in roles: return 1
if roles is None or 'Anonymous' in roles: return 1 while 'Shared' in roles: roles.remove('Shared') return self.allowed(parent,roles)
def allowed(self,parent,roles=None):
df7e95abc89b922ddf2e5d0ec93df7d688affa94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/df7e95abc89b922ddf2e5d0ec93df7d688affa94/User.py
self._storage.tpc_begin(self._transaction) self.assertRaises(POSException.UndoError, self._storage.transactionalUndo, revid, self._transaction) self._storage.tpc_abort(self._transaction)
self._storage.tpc_begin(self._transaction) oids = self._storage.transactionalUndo(revid, self._transaction) self._storage.tpc_vote(self._transaction) self._storage.tpc_finish(self._transaction) assert len(oids) == 1 assert oids[0] == oid self.assertRaises(KeyError, self._storage.load, oid, '') import Full self.asser...
def checkSimpleTransactionalUndo(self): oid = self._storage.new_oid() revid = self._dostore(oid, data=23) revid = self._dostore(oid, revid=revid, data=24) revid = self._dostore(oid, revid=revid, data=25) # Now start an undo transaction self._storage.tpc_begin(self._transaction) oids = self._storage.transactionalUndo(re...
adc93fda7996364c998ffcab89b15487c36d0160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/adc93fda7996364c998ffcab89b15487c36d0160/test_storage_api.py
+ (s,t,v)), tb
% (s,t,v)), tb
def connect(self,s):
41d484488000d510da3031b6dafd946f3b4ec30d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/41d484488000d510da3031b6dafd946f3b4ec30d/Connection.py
manage_options = ({'label':'Overview', 'action':'manage_main'},) + \ SimpleItem.manage_options
manage_options = ({'label':'Overview', 'action':'manage_main'}, {'label':'Query', 'action':'queryLexicon'}, ) + SimpleItem.manage_options
def manage_addLexicon(self, id, title='', elements=[], REQUEST=None): """Add ZCTextIndex Lexicon""" pipeline = [] for el_record in elements: if not hasattr(el_record, 'name'): continue # Skip over records that only specify element group element = element_factory.instantiate(el_record.group, el_record.name) if element ...
b96667eb6596213dbafaf0936755133c74ba195a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b96667eb6596213dbafaf0936755133c74ba195a/ZCTextIndex.py
_queryLexicon = DTMLFile('dtml/queryLexicon', globals()) def queryLexicon(self, REQUEST, words=None, page=0, rows=20, cols=4): """Lexicon browser/query user interface """ if words: wids = [] for word in words: wids.extend(self.globToWordIds(word)) words = [self.get_word(wid) for wid in wids] else: words = self.words(...
def getPipelineNames(self): """Return list of names of pipeline element classes""" return [element.__class__.__name__ for element in self._pipeline]
b96667eb6596213dbafaf0936755133c74ba195a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b96667eb6596213dbafaf0936755133c74ba195a/ZCTextIndex.py
l = parent_level(levels,current_level)
l = parent_level(levels,current_level)
def StructuredText(paragraphs): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [raw_paragraph,parsed_paragraph,[sub-paragraphs]] """ current_level = 0 current_indent = 0 levels ...
a5742e9c950695a18368831dc1eabd849750baf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a5742e9c950695a18368831dc1eabd849750baf0/ST.py
levels = tmp run.append([paragraph,[]])
levels = tmp run.append([paragraph,[]])
def StructuredText(paragraphs): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [raw_paragraph,parsed_paragraph,[sub-paragraphs]] """ current_level = 0 current_indent = 0 levels ...
a5742e9c950695a18368831dc1eabd849750baf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a5742e9c950695a18368831dc1eabd849750baf0/ST.py
arguments={} for name, arg in q._searchable_arguments().items(): arguments["%s/%s" % (id,name)]=arg
if input_id: for name, arg in q._searchable_arguments().items(): if len(qs) > 1: key="%s/%s" % (id,name) else: key=name arguments[key]=arg keys.append(key)
def add(self, report_id, report_title, report_style, input_id, input_title, queries=[], REQUEST=None): 'add a report' if not queries: raise ValueError, ( 'No <em>searchable objects</em> were selected') if not report_id: raise ValueError, ( 'No <em>report id</em> were specified') if input_title and not input_id: rais...
a6d40fd549fb346036b773f454c104713d9bb0d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a6d40fd549fb346036b773f454c104713d9bb0d5/Search.py
""" % (q.title_and_id(), q.id))
""" % (q.title_and_id(), id))
def add(self, report_id, report_title, report_style, input_id, input_title, queries=[], REQUEST=None): 'add a report' if not queries: raise ValueError, ( 'No <em>searchable objects</em> were selected') if not report_id: raise ValueError, ( 'No <em>report id</em> were specified') if input_title and not input_id: rais...
a6d40fd549fb346036b773f454c104713d9bb0d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a6d40fd549fb346036b773f454c104713d9bb0d5/Search.py
items.sort()
def default_input_form(arguments,action='query', tabs=''): if arguments: items=arguments.items() items.sort() return ( "%s\n%s%s" % ( '<!--#var standard_html_header-->\n%s\n' '<form action="%s" method="get">\n' '<h2><!--#var document_title--></h2>\n' 'Enter query parameters:<br>' '<table>\n' % (tabs,action), join( map(...
a6d40fd549fb346036b773f454c104713d9bb0d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a6d40fd549fb346036b773f454c104713d9bb0d5/Search.py
if not result: LOG('Zope', WARNING, 'invalid password for user %s' % self.getUserName())
def authenticate(self, password, request): passwrd=self._getPassword()
4d82bbe0796f05943bcbaabc2610322ca2d97994 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4d82bbe0796f05943bcbaabc2610322ca2d97994/User.py
if domains: return result and domainSpecMatch(domains, request)
if domains and result: result = domainSpecMatch(domains, request) if not result: LOG('Zope', WARNING, 'invalid domain for user %s' % self.getUserName()) return result
def authenticate(self, password, request): passwrd=self._getPassword()
4d82bbe0796f05943bcbaabc2610322ca2d97994 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4d82bbe0796f05943bcbaabc2610322ca2d97994/User.py
self._unindex[i] = tuple(d.keys())
unindex[i] = ()
def index_object(self, i, obj, tupleType=type(()), dictType=type({}), callable=callable): """Recompute index data for data with ids >= start. if 'obj' is passed in, it is indexed instead of _data[i]"""
750da777782a90c6294cb1c036cd6843a284c021 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/750da777782a90c6294cb1c036cd6843a284c021/UnTextIndex.py
else: index[word] = i, score
else: index[word] = i, score unindex[i].append(word)
def index_object(self, i, obj, tupleType=type(()), dictType=type({}), callable=callable): """Recompute index data for data with ids >= start. if 'obj' is passed in, it is indexed instead of _data[i]"""
750da777782a90c6294cb1c036cd6843a284c021 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/750da777782a90c6294cb1c036cd6843a284c021/UnTextIndex.py
schema(upper(name)]=i
schema[upper(name)]=i
def __init__(self,file,brains=NoBrains, parent=None, zbrains=None):
18ad0bb5b20d4a519ee225475544e3214da690a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/18ad0bb5b20d4a519ee225475544e3214da690a9/RDB.py
def aq_base(ob, hasattr=hasattr):
def aq_base(ob, getattr=getattr):
def aq_base(ob, hasattr=hasattr): # Return the aq_base of an object. if hasattr(ob, 'aq_base'): return ob.aq_base return ob
caffc57c633e1357305c97c70b16eab181721275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/caffc57c633e1357305c97c70b16eab181721275/Common.py
if hasattr(ob, 'aq_base'): return ob.aq_base return ob
return getattr(ob, 'aq_base', ob)
def aq_base(ob, hasattr=hasattr): # Return the aq_base of an object. if hasattr(ob, 'aq_base'): return ob.aq_base return ob
caffc57c633e1357305c97c70b16eab181721275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/caffc57c633e1357305c97c70b16eab181721275/Common.py
def is_acquired(ob, hasattr=hasattr, aq_base=aq_base, absattr=absattr): # Return true if this object is not a direct # subobject of its aq_parent object. if not hasattr(ob, 'aq_parent'): return 0 parent = aq_base(ob.aq_parent) absId = absattr(ob.id) if hasattr(parent,'_objects'): if absId+' ' in parent.objectIds(): ...
caffc57c633e1357305c97c70b16eab181721275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/caffc57c633e1357305c97c70b16eab181721275/Common.py
if hasattr(parent, absId): return 0
def is_acquired(ob, hasattr=hasattr, aq_base=aq_base, absattr=absattr): # Return true if this object is not a direct # subobject of its aq_parent object. if not hasattr(ob, 'aq_parent'): return 0 parent = aq_base(ob.aq_parent) absId = absattr(ob.id) if hasattr(parent,'_objects'): if absId+' ' in parent.objectIds(): ...
caffc57c633e1357305c97c70b16eab181721275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/caffc57c633e1357305c97c70b16eab181721275/Common.py
return 1
return 1
def is_acquired(ob, hasattr=hasattr, aq_base=aq_base, absattr=absattr): # Return true if this object is not a direct # subobject of its aq_parent object. if not hasattr(ob, 'aq_parent'): return 0 parent = aq_base(ob.aq_parent) absId = absattr(ob.id) if hasattr(parent,'_objects'): if absId+' ' in parent.objectIds(): ...
caffc57c633e1357305c97c70b16eab181721275 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/caffc57c633e1357305c97c70b16eab181721275/Common.py
def indention(str): """ Convert all tabs to the appropriate number of spaces. Find the number of leading spaces. If none, return 0 """ if str == '\n': return -1 #str = expandtabs(str) # covert tabs into spaces front = re.compile('( *)') m = front.match(str) if m: start,end = m.span() # find number of le...
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
""" returns run which is a pointer to struct to be appended to """ i = 3 run = struct[top][1] if level == 0: return struct if level == 1: return run if level == 2: a = numbers[level-2] return run[a-1][1] a = numbers[level-2] run = run[a-1][1] while i <= level: a = numbers[i-2] run = run[a-1][1] i ...
tmp = [] for x in numbers: if level > x: tmp.append(x) numbers = tmp numbers.append(level) if len(numbers) == 1: return (struct,numbers) run = struct[top][1] if level == numbers[len(numbers)-1]: i = 1 while i < level: run = run[len(run)-1][1] i = i + 1 else: i = 1 while i <= level: run = run[len(run)-1][1] i = i + 1 ...
def runner(struct,top,level,numbers): """ returns run which is a pointer to struct to be appended to """ i = 3 run = struct[top][1] if level == 0: return struct if level == 1: return run if level == 2: a = numbers[level-2] return run[a-1][1] a = numbers[level-2] run = run[a-1][1] while i <= level: a ...
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
def split_paragraphs(paragraphs): """ each paragraph is denoted by the end of a line and a blank line before the beginning of a new paragraph """ tmp = '' par = re.compile('\n[ ]*\n') if type(paragraphs).__name__ == "list": for paragraph in paragraphs: tmp = tmp + expandtabs(paragraph) paragraphs = par.split(tm...
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
levels = {0:0}
levels = {0:0}
def StructuredText(paragraphs): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [raw_paragraph,parsed_paragraph,[sub-paragraphs]] """ current_level = 0 current_indent = 0 levels ...
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
numbers = {0:0}
numbers = [0]
def StructuredText(paragraphs): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [raw_paragraph,parsed_paragraph,[sub-paragraphs]] """ current_level = 0 current_indent = 0 levels ...
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
def StructuredText(paragraphs): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [raw_paragraph,parsed_paragraph,[sub-paragraphs]] """ current_level = 0 current_indent = 0 levels ...
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
def StructuredText(paragraphs): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [raw_paragraph,parsed_paragraph,[sub-paragraphs]] """ current_level = 0 current_indent = 0 levels ...
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
for paragraph in paragraphs:
for paragraph in paragraphs:
def StructuredText(paragraphs): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [raw_paragraph,parsed_paragraph,[sub-paragraphs]] """ current_level = 0 current_indent = 0 levels ...
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
if indent > -1: if indent == 0: """ a new top header, start over, everything underneath is a sub-paragraph """ current_level = 0 current_indent = 0 top = top + 1 levels = {0:0} numbers = {0:0} struct.append([paragraph,[]]) elif indent > current_indent: current_indent = indent c...
if indent == 0: struct.append([paragraph,[]]) current_level = 0 current_indent = 0 numbers = [0] levels = {0:0} top = top + 1 elif indent == current_indent: run,numbers = runner(struct,top,current_level,numbers) run.append([paragraph,[]]) elif indent > current_indent: current_level = current...
def StructuredText(paragraphs): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [raw_paragraph,parsed_paragraph,[sub-paragraphs]] """ current_level = 0 current_indent = 0 levels ...
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
if not numbers.has_key(current_level-1): numbers[current_level-1] = 0 run = runner(struct,top,current_level,numbers) run.append([paragraph,[]]) numbers[current_level-1] = numbers[current_level-1] + 1
run,numbers = runner(struct,top,current_level,numbers) elif find_level(levels,indent) != -1: current_level = find_level(levels,indent) current_indent = indent run,numbers = runner(struct,top,current_level,numbers) elif levels[current_level] > indent and levels[l] < indent: levels[current_level] = indent current_...
def StructuredText(paragraphs): """ StructuredText accepts paragraphs, which is a list of lines to be parsed. StructuredText creates a structure which mimics the structure of the paragraphs. Structure => [raw_paragraph,parsed_paragraph,[sub-paragraphs]] """ current_level = 0 current_indent = 0 levels ...
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
self.expr = re.compile('\"[ a-zA-Z0-9.:/;,]+\":[a-zA-Z0-9.:/;,]+(?=(\s+|\.|\!|\?))').search
self.expr = re.compile('\"[ a-zA-Z0-9.:/;,\n]+\":[a-zA-Z0-9.:/;,\n]+(?=(\s+|\.|\!|\?))').search
def __init__(self,str=''): self.expr = re.compile('\"[ a-zA-Z0-9.:/;,]+\":[a-zA-Z0-9.:/;,]+(?=(\s+|\.|\!|\?))').search self.str = [str] self.typ = "href1"
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
def span(self): return self.start,self.end
8dc0c57868d1b2352ba6ff562d29142e1625d125 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/8dc0c57868d1b2352ba6ff562d29142e1625d125/ST.py
except TypeError: return 0
except (TypeError, AttributeError): return 0
def _supports(self, ob): try: ob[0] except TypeError: return 0 except: pass return 1
431601ab711627d81abcfc722af29cd58928f247 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/431601ab711627d81abcfc722af29cd58928f247/Iterator.py
return
return
def import_product(product_dir, product_name, raise_exc=0, log_exc=1): path_join=os.path.join isdir=os.path.isdir exists=os.path.exists _st=type('') global_dict=globals() silly=('__doc__',) modules=sys.modules have_module=modules.has_key if 1: # Preserve indentation for diff :-) try: package_dir=path_join(product_dir...
dd0d7ccc1277571a7367b35487cf82c9680bfee1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dd0d7ccc1277571a7367b35487cf82c9680bfee1/Application.py
return
return
def install_product(app, product_dir, product_name, meta_types, folder_permissions, raise_exc=0, log_exc=1): path_join=os.path.join isdir=os.path.isdir exists=os.path.exists DictType=type({}) global_dict=globals() silly=('__doc__',) if 1: # Preserve indentation for diff :-) package_dir=path_join(product_dir, product...
dd0d7ccc1277571a7367b35487cf82c9680bfee1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dd0d7ccc1277571a7367b35487cf82c9680bfee1/Application.py
self.__wids = OIBTree() self.__words = IOBTree()
self._wids = OIBTree() self._words = IOBTree()
def __init__(self, *pipeline): self.__wids = OIBTree() # word -> wid self.__words = IOBTree() # wid -> word # XXX we're reserving wid 0, but that might be yagni self.__nextwid = 1 self.__pipeline = pipeline
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
self.__nextwid = 1 self.__pipeline = pipeline
self._nextwid = 1 self._pipeline = pipeline
def __init__(self, *pipeline): self.__wids = OIBTree() # word -> wid self.__words = IOBTree() # wid -> word # XXX we're reserving wid 0, but that might be yagni self.__nextwid = 1 self.__pipeline = pipeline
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py