rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
call(object.manage_addFile, id=name, file=open(f)) | call(object.manage_addFile, id=name, file=open(f,'rb')) | def upload_file(object, f): if os.path.isdir(f): return upload_dir(object, f) dir, name = os.path.split(f) root, ext = os.path.splitext(name) if ext in ('file', 'dir'): ext='' else: ext=string.lower(ext) if ext and ext[0] in '.': ext=ext[1:] if ext and globals().has_key('upload_'+ext): if verbose: print 'upload_'+ext, ... | 9d889bec612f3bf809e69d44817c619206e3be32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9d889bec612f3bf809e69d44817c619206e3be32/load_site.py |
title, head, body = parse_html(f) | if doctor: title, head, body = parse_html(f) else: if old: f=f.read() title, head, body = '', '', f | def upload_html(object, f): dir, name = os.path.split(f) f=open(f) # There is a Document bugs that causes file uploads to fail. # Waaa. This will be fixed in 1.10.2. #f=f.read() title, head, body = parse_html(f) if old: call(object.manage_addDocument, id=name, file=body) else: call(object.manage_addDTMLDocument, id=... | 9d889bec612f3bf809e69d44817c619206e3be32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9d889bec612f3bf809e69d44817c619206e3be32/load_site.py |
call(object.manage_addProperty, id="loadsite-head", type="text", value=head) | call(object.manage_addProperty, id="loadsite-head", type="text", value=head) | def upload_html(object, f): dir, name = os.path.split(f) f=open(f) # There is a Document bugs that causes file uploads to fail. # Waaa. This will be fixed in 1.10.2. #f=f.read() title, head, body = parse_html(f) if old: call(object.manage_addDocument, id=name, file=body) else: call(object.manage_addDTMLDocument, id=... | 9d889bec612f3bf809e69d44817c619206e3be32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9d889bec612f3bf809e69d44817c619206e3be32/load_site.py |
call(object.manage_addDocument, id=name, file=open(f)) | f=f.read() call(object.manage_addDocument, id=name, file=f) | def upload_dtml(object, f): dir, name = os.path.split(f) if old: call(object.manage_addDocument, id=name, file=open(f)) else: call(object.manage_addDTMLDocument, id=name, file=f) | 9d889bec612f3bf809e69d44817c619206e3be32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9d889bec612f3bf809e69d44817c619206e3be32/load_site.py |
call(object.manage_addDTMLDocument, id=name, file=f) | call(object.manage_addDTMLMethod, id=name, file=f) | def upload_dtml(object, f): dir, name = os.path.split(f) if old: call(object.manage_addDocument, id=name, file=open(f)) else: call(object.manage_addDTMLDocument, id=name, file=f) | 9d889bec612f3bf809e69d44817c619206e3be32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9d889bec612f3bf809e69d44817c619206e3be32/load_site.py |
call(object.manage_addImage, id=name, file=open(f)) | call(object.manage_addImage, id=name, file=open(f,'rb')) | def upload_gif(object, f): dir, name = os.path.split(f) call(object.manage_addImage, id=name, file=open(f)) | 9d889bec612f3bf809e69d44817c619206e3be32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9d889bec612f3bf809e69d44817c619206e3be32/load_site.py |
d['rand']=math d['whrand']=math | d['rand']=rand d['whrand']=whrand | def careful_getslice(md, seq, *indexes): v=len(indexes) if v==2: v=seq[indexes[0]:indexes[1]] elif v==1: v=seq[indexes[0]:] else: v=seq[:] if type(seq) is type(''): return v # Short-circuit common case validate=md.validate if validate is not None: for e in v: if not validate(seq,seq,'',e,md): raise ValidationError, '... | c320a496c2a68f7bb4f41542c8337e408dab6e8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c320a496c2a68f7bb4f41542c8337e408dab6e8a/DT_Util.py |
query=self.template(self,argdata) | query=apply(self.template, (self,), argdata) | def __call__(self,REQUEST=None): | 3c5cb149e3d3eb004863a240a3d43523d20ede11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3c5cb149e3d3eb004863a240a3d43523d20ede11/DA.py |
self.__name__=args or tname | self.__name__="%s %s" % (tname, args) args = parse_params(args, required=1) self.args=args if args.has_key('required'): self.required=args['required'] elif args.has_key('') and args['']=='required': self.required=1 | def __init__(self, blocks): | d0c296670e90f08af6657187aa320632c8cec078 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d0c296670e90f08af6657187aa320632c8cec078/sqlgroup.py |
product.manage_options=OFS.Folder.Folder.manage_options | product.manage_options=Folder.manage_options | def initializeProduct(productp, name, home, app): # Initialize a levered product products=app.Control_Panel.Products if hasattr(productp, '__import_error__'): ie=productp.__import_error__ else: ie=None try: fver=strip(open(home+'/version.txt').read()) except: fver='' old=None try: if ihasattr(products,name): old=get... | 698b82127f36a69b8c62f9ee4be28aa2d5518a09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/698b82127f36a69b8c62f9ee4be28aa2d5518a09/Product.py |
self.report(join( traceback.format_tb(tb_tb)) + '\n') | self.report(string.join(traceback.format_tb(tb_tb)) + '\n') | def getSuiteFromFile(self, filepath): if not os.path.isfile(filepath): raise ValueError, '%s is not a file' % filepath path, filename=os.path.split(filepath) name, ext=os.path.splitext(filename) file, pathname, desc=imp.find_module(name, [path]) saved_syspath = sys.path[:] try: sys.path.append(path) # let module ... | 22a11903c0e5b78c95b1708ca63fa1723173d9ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/22a11903c0e5b78c95b1708ca63fa1723173d9ad/testrunner.py |
def custom_default_report(id, result, action='', no_table=0): | def custom_default_report(id, result, action='', no_table=0, goofy=regex.compile('[^a-zA-Z0-9_]').search ): | def custom_default_report(id, result, action='', no_table=0): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\t</tr>' % string.joinfields( map(lambda c: '\t<th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ', ' e... | 4776034943fa9e517a9f521f56917e83d3dbc338 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4776034943fa9e517a9f521f56917e83d3dbc338/Aqueduct.py |
row=('%s\n%s\t%s' % (tr,string.joinfields( map(lambda c, td=td, _td=_td: '\t%s<!-- % (td,urllib.quote(c['name']), c['type']!='s' and ' null=""' or '',_td), columns), delim), _tr)) | row=[] for c in columns: n=c['name'] if goofy(n) >= 0: n='expr="_vars[\'%s]"' % (`'"'+n`[2:]) row.append('\t%s<!-- % (td,n,c['type']!='s' and ' null=""' or '',_td)) row=('%s\n%s\t%s' % (tr,string.joinfields(row,delim), _tr)) | def custom_default_report(id, result, action='', no_table=0): columns=result._searchable_result_columns() __traceback_info__=columns heading=('<tr>\n%s\t</tr>' % string.joinfields( map(lambda c: '\t<th>%s</th>\n' % nicify(c['name']), columns), '' ) ) if no_table: tr, _tr, td, _td, delim = '<p>', '</p>', '', '', ', ' e... | 4776034943fa9e517a9f521f56917e83d3dbc338 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4776034943fa9e517a9f521f56917e83d3dbc338/Aqueduct.py |
if not ifhdr: RESPONSE.setStatus(412) | if not ifhdr: raise 'Precondition Failed', 'If Header Missing' | def LOCK(self, REQUEST, RESPONSE): """Lock a resource""" self.dav__init(REQUEST, RESPONSE) security = getSecurityManager() creator = security.getUser() body = REQUEST.get('BODY', '') ifhdr = REQUEST.get_header('If', None) depth = REQUEST.get_header('Depth', 'infinite') alreadylocked = Lockable.wl_isLocked(self) | 957c59aaf381c33dcd61a13860171f5e4a939d9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/957c59aaf381c33dcd61a13860171f5e4a939d9a/Resource.py |
raise SyntaxError, "sort oder must be either ASC or DESC" | raise SyntaxError, "sort direction must be either ASC or DESC" | def make_sortfunctions(sortfields, _): """Accepts a list of sort fields; splits every field, finds comparison function. Returns a list of 3-tuples (field, cmp_function, asc_multplier)""" sf_list = [] for field in sortfields: f = list(field) l = len(f) if l == 1: f.append("cmp") f.append("asc") elif l == 2: f.append("... | 439b7d37c880170bbb9ff35f11558acbd767b349 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/439b7d37c880170bbb9ff35f11558acbd767b349/SortEx.py |
Cache._setPropValue(self, id, value) | PropertyManager._setPropValue(self, id, value) | def _setPropValue(self, id, value): Cache._setPropValue(self, id, value) self.ZCacheable_invalidate() | 255d1174daada068be0087f8f724324d956ac323 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/255d1174daada068be0087f8f724324d956ac323/ZopePageTemplate.py |
r.append(name, value) | r.append((name, value)) | def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument. Arguments: qs: URL-encoded query string to be parsed keep_blank_values: flag indicating whether blank values in URL encoded queries should be treated as blank strings. A true value inicates that blanks should be re... | d8f773825075f9ec012276b9f3055919bb608dd2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d8f773825075f9ec012276b9f3055919bb608dd2/cgi.py |
'cst':'Us/Central','cuba':'Cuba','est':'US/Eastern','egypt':'Egypt', | 'cst':'US/Central','cuba':'Cuba','est':'US/Eastern','egypt':'Egypt', | 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')] | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
def _findLocalTimeZoneName(isDST): if not daylight: isDST = 0 try: _localzone = _cache._zmap[lower(tzname[isDST])] except: try: _localzone = _cache._zmap[lower(tzname[0])] except: try: if isDST: localzone = altzone else: localzone = timezone offset=(-localzone/(60*60)) majorOffset=int(offset) if majorOffset != 0 ... | def __getitem__(self,k): try: n=self._zmap[lower(k)] except KeyError: if numericTimeZoneMatch(k) <= 0: raise 'DateTimeError','Unrecognized timezone: %s' % k return k try: return self._d[n] except KeyError: z=self._d[n]=_timezone(self._db[n]) return z | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py | |
t,tz=time(),self._localzone ms=(t-int(t)) yr,mo,dy,hr,mn,sc=gmtime(int(t))[:6] s=(hr/24.0+mn/1440.0+(sc+ms)/86400.0) d=(self._julianday(yr,mo,dy)-jd1901)+s yr,mo,dy,hr,mn,sc=localtime(t)[:6] | t = time() lt = safelocaltime(t) tz = self.localZone(lt) ms = (t - math.floor(t)) s,d = _calcSD(t) yr,mo,dy,hr,mn,sc=lt[:6] | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py | ||
ms=(t-int(t)) yr,mo,dy,hr,mn,sc=gmtime(t)[:6] s=(hr/24.0+mn/1440.0+(sc+ms)/86400.0) d=(self._julianday(yr,mo,dy)-jd1901)+s x=d+(self._tzinfo[tz].info(t)[0]/86400.0) yr,mo,dy=self._calendarday(x+jd1901) x=(x-int(x))*86400.0 hr=int(x/3600) x=x-(hr*3600) mn=int(x/60) sc=x-(mn*60) | ms=(t-math.floor(t)) s,d = _calcSD(t) x = _calcDependentSecond(tz, t) yr,mo,dy,hr,mn,sc = _calcYMDHMS(x, ms) | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
try: tz=self._tzinfo._zmap[lower(tz)] except KeyError: if numericTimeZoneMatch(tz) <= 0: raise self.DateTimeError, 'Invalid date: %s' % arg | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py | |
s=(hr/24.0+mn/1440.0+sc/86400.0) d=(self._julianday(yr,mo,dy)-jd1901)+s t=(d*86400.0)-EPOCH+86400.0 try: a=self._tzinfo[tz].info(t)[0] except: if numericTimeZoneMatch(tz) > 0: a=atoi(tz[1:3])*3600+atoi(tz[3:5])*60 d,t=d-(a/86400.0),t-a | ms = sc - math.floor(sc) x = _calcDependentSecond2(yr,mo,dy,hr,mn,sc) if tz: try: tz=self._tzinfo._zmap[lower(tz)] except KeyError: if numericTimeZoneMatch(tz) <= 0: raise self.DateTimeError, \ 'Unknown time zone in date: %s' % arg else: tz = self._calcTimezoneName(x, ms) s,d,t,millisecs = _calcIndependentSecondEtc(tz... | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
t,tz=arg,self._localzone ms=(t-int(t)) yr,mo,dy,hr,mn,sc=gmtime(int(t))[:6] s=(hr/24.0+mn/1440.0+(sc+ms)/86400.0) d=(self._julianday(yr,mo,dy)-jd1901)+s yr,mo,dy,hr,mn,sc=localtime(t)[:6] | t = arg lt = safelocaltime(t) tz = self.localZone(lt) ms=(t-math.floor(t)) s,d = _calcSD(t) yr,mo,dy,hr,mn,sc=lt[:6] | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
ms=(t-int(t)) | ms = (t - math.floor(t)) | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
yr,mo,dy,hr,mn,sc=gmtime(t)[:6] s=(hr/24.0+mn/1440.0+(sc+ms)/86400.0) d=(self._julianday(yr,mo,dy)-jd1901)+s x=d+(self._tzinfo[tz].info(t)[0]/86400.0) yr,mo,dy=self._calendarday(x+jd1901) x=(x-int(x))*86400.0 hr=int(x/3600) x=x-(hr*3600) mn=int(x/60) sc=x-(mn*60) if(hr==23 and mn==59 and sc>59.999): hr,mn,sc=0,0,0.0 e... | s,d = _calcSD(t) x = _calcDependentSecond(tz, t) yr,mo,dy,hr,mn,sc = _calcYMDHMS(x, ms) | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
tz=self._localzone | t = time() lt = safelocaltime(t) tz = self.localZone(lt) | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
d=(self._julianday(yr,1,0)-jd1901)+jul yr,mo,dy=self._calendarday(d+jd1901) x=(d-int(d))*86400.0 hr=int(x/3600) x=x-(hr*3600) mn=int(x/60) sc=x-(mn*60) if(hr==23 and mn==59 and sc>59.999): hr,mn,sc=0,0,0.0 else: if hr<0: hr=23+hr if mn<0: mn=59+mn if sc<0: if (sc-int(sc)>=0.999): sc=round(sc) sc=59+sc d=d-(self._tzin... | d=(_julianday(yr,1,0)-jd1901)+jul x_float = d * 86400.0 x_floor = math.floor(x_float) ms = x_float - x_floor x = long(x_floor) yr,mo,dy,hr,mn,sc = _calcYMDHMS(x, ms) s,d,t,millisecs = _calcIndependentSecondEtc(tz, x, ms) | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
if not tz: tz=self._localzone else: tz=self._tzinfo._zmap[lower(tz)] leap=yr%4==0 and (yr%100!=0 or yr%400==0) s=(hr/24.0+mn/1440.0+sc/86400.0) d=(self._julianday(yr,mo,dy)-jd1901)+s t=(d*86400.0)-EPOCH+86400.0 a=self._tzinfo[tz].info(t)[0] d,t=d-(a/86400.0),t-a | leap = (yr % 4 == 0) and (yr % 100 != 0 or yr % 400 == 0) x = _calcDependentSecond2(yr,mo,dy,hr,mn,sc) ms = sc - math.floor(sc) if tz: try: tz=self._tzinfo._zmap[lower(tz)] except KeyError: if numericTimeZoneMatch(tz) <= 0: raise self.DateTimeError, \ 'Unknown time zone: %s' % tz else: tz = self._calcTimezoneName(x, ... | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
self._dayoffset=dx=int((self._julianday(yr,mo,dy)+2L)%7) | self._dayoffset=dx=int((_julianday(yr,mo,dy)+2L)%7) | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
if millisecs is None: millisecs = long(math.floor(t * 1000.0)) self._millis = millisecs | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py | |
try: _localzone=_cache._zmap[lower(tzname[0])] except: | _localzone0 = _findLocalTimeZoneName(0) _localzone1 = _findLocalTimeZoneName(1) _multipleZones = (_localzone0 != _localzone1) _isDST = localtime(time())[8] _localzone = _isDST and _localzone1 or _localzone0 _tzinfo = _cache() def localZone(self, ltm=None): '''Returns the time zone on the given date. The time z... | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
t=time() localzone=float(int(mktime(gmtime(t))) - int(t)) offset=(-localzone/(60*60)) majorOffset=int(offset) if majorOffset != 0 : minorOffset=abs(int((offset % majorOffset) * 60.0)) else: minorOffset = 0 m=majorOffset >= 0 and '+' or '' lz='%s%0.02d%0.02d' % (m, majorOffset, minorOffset) _localzone=_cache._zmap[lower... | ltm = safelocaltime(nearTime) except: yr,mo,dy,hr,mn,sc = _calcYMDHMS(x, 0) yr = ((yr - 1970) % 28) + 1970 x = _calcDependentSecond2(yr,mo,dy,hr,mn,sc) nearTime = x - fsetAtEpoch - long(EPOCH) + 86400L + ms ltm = safelocaltime(nearTime) tz = self.localZone(ltm) return tz | def __init__(self,*args): """Return a new date-time object | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
sp=split(strip(string)) | string = strip(string) sp=split(string) | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones ... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
else: tz=self._localzone | else: tz = None | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones ... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
if day is None: raise self.SyntaxError, string | if day is None: year,month,day = localtime(time())[:3] | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones ... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
hr=int(t/3600) t=t-hr*3600 mn=int(t/60) sc=t-mn*60 tz=tz or self._localzone | t_int = long(math.floor(t)) hr,mn,sc = _calcHMS(t_int, t - t_int) if not tz: x = _calcDependentSecond2(year,month,day,hr,mn,sc) tz = self._calcTimezoneName(x, t - t_int) | def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones ... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
def _parse(self,string): # Parse date-time components from a string month=year=tz=tm=None spaces =self.space_chars intpat =self.int_pattern fltpat =self.flt_pattern wordpat =self.name_pattern delimiters =self.delimiters MonthNumbers =self._monthmap DayOfWeekNames=self._daymap ValidZones ... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py | ||
def _julianday(self,yr,mo,dy): y,m,d=long(yr),long(mo),long(dy) if m > 12L: y=y+m/12L m=m%12L elif m < 1L: m=-m y=y-m/12L-1L m=12L-m%12L if y > 0L: yr_correct=0L else: yr_correct=3L if m < 3L: y, m=y-1L,m+12L if y*10000L+m*100L+d > 15821014L: b=2L-y/100L+y/400L else: b=0L return (1461L*y-yr_correct)/4L+306001L*(m+... | def _julianday(self,yr,mo,dy): y,m,d=long(yr),long(mo),long(dy) if m > 12L: y=y+m/12L m=m%12L elif m < 1L: m=-m y=y-m/12L-1L m=12L-m%12L if y > 0L: yr_correct=0L else: yr_correct=3L if m < 3L: y, m=y-1L,m+12L if y*10000L+m*100L+d > 15821014L: b=2L-y/100L+y/400L else: b=0L return (1461L*y-yr_correct)/4L+306001L*(m+... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py | |
if (t>0 and ((t/86400.0) < 24837)): yr,mo,dy,hr,mn,sc=gmtime(t+self._tzinfo[tz].info(t)[0])[:6] | millis = self.millis() try: yr,mo,dy,hr,mn,sc=safegmtime(t+_tzoffset(tz, t))[:6] | def toZone(self, z): """Return a DateTime with the value as the current object, represented in the indicated timezone.""" t,tz=self._t,self._tzinfo._zmap[lower(z)] if (t>0 and ((t/86400.0) < 24837)): # Try to cheat and use time module for speed... yr,mo,dy,hr,mn,sc=gmtime(t+self._tzinfo[tz].info(t)[0])[:6] sc=self._sec... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
return self.__class__(yr,mo,dy,hr,mn,sc,tz,t,self._d,self.time) d=self._d+(self._tzinfo[tz].info(t)[0]/86400.0) yr,mo,dy=self._calendarday((d+jd1901)) s=(d-int(d))*86400.0 hr=int(s/3600) s=s-(hr*3600) mn=int(s/60) sc=s-(mn*60) if(hr==23 and mn==59 and sc>59.999): hr,mn,sc=0,0,0.0 else: if hr<0: hr=23+hr if mn<0: mn=5... | return self.__class__(yr,mo,dy,hr,mn,sc,tz,t, self._d,self.time,millis) except: tzdiff = _tzoffset(tz, t) - _tzoffset(self._tz, t) if tzdiff == 0: return self sc = self._second ms = sc - math.floor(sc) x = _calcDependentSecond2(self._year, self._month, self._day, self._hour, self._minute, sc) x_new = x + tzdiff yr,mo,... | def toZone(self, z): """Return a DateTime with the value as the current object, represented in the indicated timezone.""" t,tz=self._t,self._tzinfo._zmap[lower(z)] if (t>0 and ((t/86400.0) < 24837)): # Try to cheat and use time module for speed... yr,mo,dy,hr,mn,sc=gmtime(t+self._tzinfo[tz].info(t)[0])[:6] sc=self._sec... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
return gmtime(t+self._tzinfo[self._tz].info(t)[0])[0]==self._year | return safegmtime(t+_tzoffset(self._tz, t))[0]==self._year | def isCurrentYear(self): """Return true if this object represents a date/time that falls within the current year, in the context of this object\'s timezone representation""" t=time() return gmtime(t+self._tzinfo[self._tz].info(t)[0])[0]==self._year | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
return gmtime(t+self._tzinfo[self._tz].info(t)[0])[1]==self._month | return safegmtime(t+_tzoffset(self._tz, t))[1]==self._month | def isCurrentMonth(self): """Return true if this object represents a date/time that falls within the current month, in the context of this object\'s timezone representation""" t=time() return gmtime(t+self._tzinfo[self._tz].info(t)[0])[1]==self._month | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
return gmtime(t+self._tzinfo[self._tz].info(t)[0])[2]==self._day | return safegmtime(t+_tzoffset(self._tz, t))[2]==self._day | def isCurrentDay(self): """Return true if this object represents a date/time that falls within the current day, in the context of this object\'s timezone representation""" t=time() return gmtime(t+self._tzinfo[self._tz].info(t)[0])[2]==self._day | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
return gmtime(t+self._tzinfo[self._tz].info(t)[0])[3]==self._hour | return safegmtime(t+_tzoffset(self._tz, t))[3]==self._hour | def isCurrentHour(self): """Return true if this object represents a date/time that falls within the current hour, in the context of this object\'s timezone representation""" t=time() return gmtime(t+self._tzinfo[self._tz].info(t)[0])[3]==self._hour | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
return gmtime(t+self._tzinfo[self._tz].info(t)[0])[4]==self._minute | return safegmtime(t+_tzoffset(self._tz, t))[4]==self._minute | def isCurrentMinute(self): """Return true if this object represents a date/time that falls within the current minute, in the context of this object\'s timezone representation""" t=time() return gmtime(t+self._tzinfo[self._tz].info(t)[0])[4]==self._minute | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
or time module style time.""" try: return (self._d > t._d) | or time module style time. Revised to give more correct results through comparison of long integer milliseconds. """ try: return (self.millis() > t.millis()) | def greaterThan(self,t): """Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time greater than the specified DateTime or time module style time.""" try: return (self._d > t._d) exc... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
specified DateTime or time module style time.""" try: return (self._d >= t._d) | specified DateTime or time module style time. Revised to give more correct results through comparison of long integer milliseconds. """ try: return (self.millis() >= t.millis()) | def greaterThanEqualTo(self,t): """Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time greater than or equal to the specified DateTime or time module style time.""" try: return (... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
or time module style time.""" try: return (self._d == t._d) | or time module style time. Revised to give more correct results through comparison of long integer milliseconds. """ try: return (self.millis() == t.millis()) | def equalTo(self,t): """Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time equal to the specified DateTime or time module style time.""" try: return (self._d == t._d) except: re... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
or time module style time.""" try: return (self._d != t._d) | or time module style time. Revised to give more correct results through comparison of long integer milliseconds. """ try: return (self.millis() != t.millis()) | def notEqualTo(self,t): """Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time not equal to the specified DateTime or time module style time.""" try: return (self._d != t._d) exc... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
or time module style time.""" try: return (self._d < t._d) | or time module style time. Revised to give more correct results through comparison of long integer milliseconds. """ try: return (self.millis() < t.millis()) | def lessThan(self,t): """Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time less than the specified DateTime or time module style time.""" try: return (self._d < t._d) except: r... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
DateTime or time module style time.""" try: return (self._d <= t._d) | DateTime or time module style time. Revised to give more correct results through comparison of long integer milliseconds. """ try: return (self.millis() <= t.millis()) | def lessThanEqualTo(self,t): """Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time less than or equal to the specified DateTime or time module style time.""" try: return (self._... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
d=int(self._d+(self._tzinfo[self._tz].info(self._t)[0]/86400.0)) return int((d+jd1901)-self._julianday(self._year,1,0)) | d=int(self._d+(_tzoffset(self._tz, self._t)/86400.0)) return int((d+jd1901)-_julianday(self._year,1,0)) | def dayOfYear(self): """Return the day of the year, in context of the timezone representation of the object""" d=int(self._d+(self._tzinfo[self._tz].info(self._t)[0]/86400.0)) return int((d+jd1901)-self._julianday(self._year,1,0)) | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
d,t,tz=(self._d+o),(self._t+(o*86400.0)),self._tz x=d+(self._tzinfo[tz].info(t)[0]/86400.0) yr,mo,dy=self._calendarday((x+jd1901)) s=(x-int(x))*86400.0 hr=int(s/3600) s=s-(hr*3600) mn=int(s/60) s=s-(mn*60) return self.__class__(yr,mo,dy,hr,mn,s,self._tz,t,d,(d-int(d))) | tz = self._tz t = (self._t + (o*86400.0)) d = (self._d + o) s = d - math.floor(d) ms = t - math.floor(t) x = _calcDependentSecond(tz, t) yr,mo,dy,hr,mn,sc = _calcYMDHMS(x, ms) return self.__class__(yr,mo,dy,hr,mn,sc,self._tz,t,d,s) | def __add__(self,other): """A DateTime may be added to a number and a number may be added to a DateTime; two DateTimes cannot be added.""" if hasattr(other,'_t'): raise self.DateTimeError,'Cannot add two DateTimes' o=float(other) d,t,tz=(self._d+o),(self._t+(o*86400.0)),self._tz x=d+(self._tzinfo[tz].info(t)[0]/86400.... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
return '%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%g %s' % ( y,m,d,h,mn,s,t) else: return '%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d %s' % ( y,m,d,h,mn,s,t) | try: subsec = split('%g' % s, '.')[1] return '%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%s %s' % ( y,m,d,h,mn,s,subsec,t) except: pass return '%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d %s' % ( y,m,d,h,mn,s,t) return '%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d %s' % ( y,m,d,h,mn,s,t) | def __str__(self): """Convert a DateTime to a string.""" y,m,d =self._year,self._month,self._day h,mn,s,t=self._hour,self._minute,self._second,self._tz if(h+mn+s): if (s-int(s))> 0.0001: return '%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%g %s' % ( y,m,d,h,mn,s,t) else: return '%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d %s' % ( y,m,d,h... | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
try: return cmp(self._d,obj._d) | try: return cmp(self.millis(), obj.millis()) | def __cmp__(self,obj): """Compare a DateTime with another DateTime object, or a float such as those returned by time.time(). | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
return int(self._t) | return int(self.millis() / 1000) | def __int__(self): """Convert to an integer number of seconds since the epoch (gmt)""" return int(self._t) | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
return long(self._t) | return long(self.millis() / 1000) | def __long__(self): """Convert to a long-int number of seconds since the epoch (gmt)""" return long(self._t) | befc802c3f8f99550f565b61586bed86f5a03c2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/befc802c3f8f99550f565b61586bed86f5a03c2d/DateTime.py |
elif lower(strip(b))[:6]=='<html>': | elif lower(strip(b))[:6]=='<html>' or lower(strip(b))[:14]=='<!doctype html': | def exception(self, fatal=0, info=None, absuri_match=regex.compile( "^" "\(/\|\([a-zA-Z0-9+.-]+:\)\)" "[^\000- \"\\#<>]*" "\\(#[^\000- \"\\#<>]*\\)?" "$" ).match, tag_search=regex.compile('[a-zA-Z]>').search, ): if type(info) is type(()) and len(info)==3: t,v,tb = info else: t,v,tb = sys.exc_info() | afc624a5d1244a241f448bafd5586a8f9c8c6dd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/afc624a5d1244a241f448bafd5586a8f9c8c6dd0/HTTPResponse.py |
Add an external method to an ObjectManager. | Add an external method to an 'ObjectManager'. | def manage_addExternalMethod(self, id, title, module, function): """ Add an external method to an ObjectManager. In addition to the standard object-creation arguments, 'id' and title, the following arguments are defined: function -- The name of the python function. This can be a an ordinary Python function, or a bou... | a6e256ebfbc53fee66f44c8c1d918e15db6c4530 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a6e256ebfbc53fee66f44c8c1d918e15db6c4530/ExternalMethod.py |
Web-callable functions that encapsulate external python functions. | Web-callable functions that encapsulate external Python functions. | def manage_addExternalMethod(self, id, title, module, function): """ Add an external method to an ObjectManager. In addition to the standard object-creation arguments, 'id' and title, the following arguments are defined: function -- The name of the python function. This can be a an ordinary Python function, or a bou... | a6e256ebfbc53fee66f44c8c1d918e15db6c4530 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a6e256ebfbc53fee66f44c8c1d918e15db6c4530/ExternalMethod.py |
Change the external method | Change the External Method. | def manage_edit(self, title, module, function, REQUEST=None): """ Change the external method | a6e256ebfbc53fee66f44c8c1d918e15db6c4530 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a6e256ebfbc53fee66f44c8c1d918e15db6c4530/ExternalMethod.py |
Call an ExternalMethod | Call the External Method. | def __call__(self, *args, **kw): | a6e256ebfbc53fee66f44c8c1d918e15db6c4530 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a6e256ebfbc53fee66f44c8c1d918e15db6c4530/ExternalMethod.py |
def testEmptyLists(self): self.assertEqual(len(mass_weightedIntersection([])), 0) self.assertEqual(len(mass_weightedUnion([])), 0) def testIdentity(self): t = IIBTree([(1, 2)]) b = IIBucket([(1, 2)]) for x in t, b: for func in mass_weightedUnion, mass_weightedIntersection: result = func([(x, 1)]) self.assertEqual(len(... | def mass_weightedUnion(L): "A list of (mapping, weight) pairs -> their weightedUnion IIBTree." if not L: return IIBTree() if len(L) == 1: x, weight = L[0] dummy, result = weightedUnion(IIBTree(), x, 1, weight) return result assert len(L) > 1 merge = NBest(len(L)) for x, weight in L: merge.add((x, weight), len(x)) wh... | def testEmptyLists(self): self.assertEqual(len(mass_weightedIntersection([])), 0) self.assertEqual(len(mass_weightedUnion([])), 0) | 08fe38f47371237d87218791877ebd7fb0062cdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/08fe38f47371237d87218791877ebd7fb0062cdb/SetOps.py |
class Navigation: | class Navigation(ExtensionClass.Base): | def tabs_path_info(self, script, path): url=script out=[] while path[:1]=='/': path=path[1:] while path[-1:]=='/': path=path[:-1] while script[:1]=='/': script=script[1:] while script[-1:]=='/': script=script[:-1] path=split(path,'/')[:-1] if script: path=[script]+path if not path: return '' script='' last=path[-1] del... | 5b3808aa090f89f09652d7fb6cb416be5716fbd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5b3808aa090f89f09652d7fb6cb416be5716fbd0/Management.py |
pc.__propset_attrs__=tuple(map(lambda o: o[0], self._objects)) | pc.__propset_attrs__=tuple(map(lambda o: o['id'], self._objects)) | def _delOb(self, id): delattr(self, id) pc=self.aq_inner.aq_parent.aq_parent._zclass_propertysheets_class delattr(pc,id) pc.__propset_attrs__=tuple(map(lambda o: o[0], self._objects)) rclass(pc) | d137d925e99c4855373937116bc7b8c83fe85e87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d137d925e99c4855373937116bc7b8c83fe85e87/Property.py |
""") | (%s)""" % repr(self)) | def __getstate__(self): raise SystemError, ( """This object was originally created by a product that is no longer installed. It cannot be updated. """) | 86c71d1641382e5e9027aefc265438a9a4ef225f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/86c71d1641382e5e9027aefc265438a9a4ef225f/Uninstalled.py |
'manage_tabs','manage_propertiesForm','manage_UndoForm', 'objectIds', 'objectValues', 'objectItems','hasProperty',)), | 'manage_tabs','manage_propertiesForm','manage_UndoForm',)), | def manage_addFolder(self,id,title='',createPublic=0,createUserF=0, REQUEST=None): """Add a new Folder object with id *id*. If the 'createPublic' and 'createUserF' parameters are set to any true value, an 'index_html' and a 'UserFolder' objects are created respectively in the new folder. """ i=self.folderClass()() i.i... | 4f6c4876adcf78294316c1d1879b8a99f3edbb9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4f6c4876adcf78294316c1d1879b8a99f3edbb9a/Folder.py |
"""Return the object in the format used in the HTML4.0 specification, one of the standard forms in ISO8601. See | """Return the object in the format used in the HTML4.0 specification, one of the standard forms in ISO8601. See | def HTML4(self): """Return the object in the format used in the HTML4.0 specification, one of the standard forms in ISO8601. See http://www.w3.org/TR/NOTE-datetime | 961c6ad8a6a9fb51f2b1fa241e796c00c4b91e41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/961c6ad8a6a9fb51f2b1fa241e796c00c4b91e41/DateTime.py |
'multiple selection': field2lines, | def convert_unicode(self,v): return field2utext.convert_unicode(v).split('\n') | 36a4864bf4dc3e627735ccc6c8297f772ac57e2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/36a4864bf4dc3e627735ccc6c8297f772ac57e2d/Converters.py | |
__import_error__=None | import_error_=None | def _canCopy(self, op=0): return 0 | 4467942d44ddb03545adf92a2151069efb0f9e20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4467942d44ddb03545adf92a2151069efb0f9e20/Product.py |
if hasattr(productp, '__import_error__'): ie=productp.__import_error__ | if hasattr(productp, 'import_error_'): ie=productp.import_error_ | def initializeProduct(productp, name, home, app): # Initialize a levered product products=app.Control_Panel.Products if hasattr(productp, '__import_error__'): ie=productp.__import_error__ else: ie=None try: fver=strip(open(home+'/version.txt').read()) except: fver='' old=None try: if ihasattr(products,name): old=get... | 4467942d44ddb03545adf92a2151069efb0f9e20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4467942d44ddb03545adf92a2151069efb0f9e20/Product.py |
hasattr(old, '__import_error__') and old.__import_error__==ie): | hasattr(old, 'import_error_') and old.import_error_==ie): | def initializeProduct(productp, name, home, app): # Initialize a levered product products=app.Control_Panel.Products if hasattr(productp, '__import_error__'): ie=productp.__import_error__ else: ie=None try: fver=strip(open(home+'/version.txt').read()) except: fver='' old=None try: if ihasattr(products,name): old=get... | 4467942d44ddb03545adf92a2151069efb0f9e20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4467942d44ddb03545adf92a2151069efb0f9e20/Product.py |
text="%s %s %s" % (text, api.SearchableText()) | text="%s %s" % (text, api.SearchableText()) | def SearchableText(self): "The full text of the Help Topic, for indexing purposes" text="%s %s" % (self.title, self.doc) for api in self.apis: text="%s %s %s" % (text, api.SearchableText()) return text | 832f5c636d86bdcb8bef63a1bcffaaeb284b9867 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/832f5c636d86bdcb8bef63a1bcffaaeb284b9867/APIHelpTopic.py |
!='text/html'): raise | !='text/html'): raise t, v, traceback | def zpublisher_exception_hook(published, REQUEST, t, v, traceback): try: if isinstance(t, StringType): if t.lower() in ('unauthorized', 'redirect'): raise else: if t is SystemExit: raise if issubclass(t, ConflictError): # First, we need to close the current connection. We'll # do this by releasing the hold on it. There... | 7ec7171d71b58e647c5192aa595209548e07e1cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/7ec7171d71b58e647c5192aa595209548e07e1cb/startup.py |
return self.manage_cacheParameters(self,REQUEST) | if REQUEST is not None: response=REQUEST['RESPONSE'] response.redirect(REQUEST['URL1']+'/manage_cacheParameters') | def manage_cache_age(self,value,REQUEST): "set cache age" try: v=self._p_jar.getVersion() except: # BoboPOS2: if self._p_jar.db is not Globals.Bobobase._jar.db: raise 'Version Error', ( '''You may not change the database cache age while working in a <em>version</em>''') self._cache_age=Globals.Bobobase._jar.cache.cache... | 93134a644322e3d4768e743498faddead223d85a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/93134a644322e3d4768e743498faddead223d85a/CacheManager.py |
def cache_size(self): try: if self._p_jar.getVersion(): return self._vcache_size except: pass | 93134a644322e3d4768e743498faddead223d85a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/93134a644322e3d4768e743498faddead223d85a/CacheManager.py | ||
return self.manage_cacheParameters(self,REQUEST) | if REQUEST is not None: response=REQUEST['RESPONSE'] response.redirect(REQUEST['URL1']+'/manage_cacheParameters') | def manage_cache_size(self,value,REQUEST): "set cache size" try: v=self._p_jar.getVersion() except: # BoboPOS2: if self._p_jar.db is not Globals.Bobobase._jar.db: raise 'Version Error', ( '''You may not change the database cache size while working in a <em>version</em>''') self._cache_size=Globals.Bobobase._jar.cache.c... | 93134a644322e3d4768e743498faddead223d85a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/93134a644322e3d4768e743498faddead223d85a/CacheManager.py |
return self.manage_cacheGC(self,REQUEST) | if REQUEST is not None: response=REQUEST['RESPONSE'] response.redirect(REQUEST['URL1']+'/manage_cacheGC') | def manage_full_sweep(self,value,REQUEST): "Perform a full sweep through the cache" try: db=self._p_jar.db() except: # BoboPOS2 Globals.Bobobase._jar.cache.full_sweep(value) else: db.cacheFullSweep(value) | 93134a644322e3d4768e743498faddead223d85a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/93134a644322e3d4768e743498faddead223d85a/CacheManager.py |
return self.manage_cacheGC(self,REQUEST) | if REQUEST is not None: response=REQUEST['RESPONSE'] response.redirect(REQUEST['URL1']+'/manage_cacheGC') | def manage_minimize(self,value,REQUEST): "Perform a full sweep through the cache" try: db=self._p_jar.db() except: # BoboPOS2 Globals.Bobobase._jar.cache.minimize(value) else: db.cacheMinimize(value) | 93134a644322e3d4768e743498faddead223d85a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/93134a644322e3d4768e743498faddead223d85a/CacheManager.py |
security.declareProtected('query', search_zcatalog) | security.declareProtected(search_zcatalog, 'query') | def getLexicon(self): """Get the lexicon for this index """ if hasattr(aq_base(self), 'lexicon'): # Fix up old ZCTextIndexes by removing direct lexicon ref # and changing it to an ID lexicon = getattr(aq_parent(aq_inner(self)), self.lexicon.getId()) self.lexicon_id = lexicon.getId() del self.lexicon | fb6ede6bf7a66c5e2840b99a25f0b13b96b3ef80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/fb6ede6bf7a66c5e2840b99a25f0b13b96b3ef80/ZCTextIndex.py |
schema[lower(name)]=i schema[upper(name)]=i | n=lower(name) if n != name: aliases.append((n, SQLAlias(name))) n=upper(name) if n != name: aliases.append((n, SQLAlias(name))) | def __init__(self,file,brains=NoBrains, parent=None, zbrains=None): | 867a0555f053e7f9a19e094d1a66b78adb94ddbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/867a0555f053e7f9a19e094d1a66b78adb94ddbe/RDB.py |
for _def in defs: _def=strip(_def) if not _def: raise ValueError, ('Empty column definition for %s' % names[i]) if defre.match(_def) < 0: raise ValueError, ( 'Invalid column definition for, %s, for %s' % _def, names[i]) type=lower(defre.group(2)) width=defre.group(1) if width: width=atoi(width) else: width=8 | 867a0555f053e7f9a19e094d1a66b78adb94ddbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/867a0555f053e7f9a19e094d1a66b78adb94ddbe/RDB.py | ||
d=r.__dict__ for k, v in aliases: if not hasattr(r,k): d[k]=v | for _def in defs: _def=strip(_def) if not _def: raise ValueError, ('Empty column definition for %s' % names[i]) if defre.match(_def) < 0: raise ValueError, ( 'Invalid column definition for, %s, for %s' % _def, names[i]) type=lower(defre.group(2)) width=defre.group(1) if width: width=atoi(width) else: width=8 | 867a0555f053e7f9a19e094d1a66b78adb94ddbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/867a0555f053e7f9a19e094d1a66b78adb94ddbe/RDB.py | |
self.assertEqual(factory.host, '') | self.assertEqual(factory.host, DEFAULT_HOSTNAME) | def test_ftp_factory(self): factory = self.load_factory("""\ <ftp-server> address 84 </ftp-server> """) self.assert_(isinstance(factory, ZServer.datatypes.FTPServerFactory)) self.assertEqual(factory.host, '') self.assertEqual(factory.port, 84) self.check_prepare(factory) factory.create().close() | e9480b298c1f1b56e340d02ebc5a16d32fff28d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e9480b298c1f1b56e340d02ebc5a16d32fff28d0/test_config.py |
realm=request.environ['BOBO_REALM'] | realm=os.environ['BOBO_REALM'] | def get_module_info(module_name, modules={}, acquire=_l.acquire, release=_l.release, ): if modules.has_key(module_name): return modules[module_name] if module_name[-4:]=='.cgi': module_name=module_name[:-4] acquire() tb=None try: try: module=__import__(module_name, globals(), globals(), ('__doc__',)) realm=module_n... | d61daf3c4663ddd112e39feb64ad135f23ff5a4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/d61daf3c4663ddd112e39feb64ad135f23ff5a4c/Publish.py |
columns=result._searchable_result_columns() | columns=result._searchable_result_columns() __traceback_info__=columns | def custom_default_report(id, result, action=''): columns=result._searchable_result_columns() heading=('<tr>\n%s</tr>' % string.joinfields( map(lambda c: '\t<th>%s</th>\n' % nicify(c['name']), columns), '' ) ) row=('<tr>\n%s</tr>' % string.joinfields( map(lambda c: '\t\t<td><!--#var %s%s--></td>\n' % (urllib.quote(c['n... | 033942a7176bd1b10ac8a241f15415863a5653e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/033942a7176bd1b10ac8a241f15415863a5653e8/Aqueduct.py |
self._v_cache={} | self._v_cache={}, IOBTree.Bucket() | def manage_advanced(self, key, max_rows, max_cache, cache_time, | 820c7c14877fa771d21f5af3109279d4d99493aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/820c7c14877fa771d21f5af3109279d4d99493aa/DA.py |
rec.append(default_value, name) | rec.append(default_value) | def addColumn(self, name, default_value=None): """ adds a row to the meta data schema """ schema = self.schema names = list(self.names) | 422a17d8959ec03fa742c6be4d1859067fdd8e2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/422a17d8959ec03fa742c6be4d1859067fdd8e2d/Catalog.py |
del self.data[rid] del self.uids[uid] del self.paths[rid] | try: del self.data[rid] except: pass try: del self.uids[uid] except: pass try: del self.paths[rid] except: pass | def uncatalogObject(self, uid): """ | 422a17d8959ec03fa742c6be4d1859067fdd8e2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/422a17d8959ec03fa742c6be4d1859067fdd8e2d/Catalog.py |
if not basic_type(k): | if not basic_type(type(k)): | def sort_sequence(self, sequence): | b8e170d1348a6bb205c2ac0ba13701b7f1b0a79a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b8e170d1348a6bb205c2ac0ba13701b7f1b0a79a/DT_In.py |
for name, who_cares in method.ac_inherited_permissions(1): p=perms.get(getPermissionMapping(name, wrapper), '') a({'permission_name': name, 'class_permission': p}) | for ac_perms in method.ac_inherited_permissions(1): p=perms.get(getPermissionMapping(ac_perms[0], wrapper), '') a({'permission_name': ac_perms[0], 'class_permission': p}) | def manage_getPermissionMapping(self): """Return the permission mapping for the object | 62063ba723bca04c77ea8c288075345b584ef10c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/62063ba723bca04c77ea8c288075345b584ef10c/Method.py |
has_key = request.has_key if has_key(cidid): keys = request[cidid] elif has_key(id): keys = request[id] else: return None if type(keys) is not ListType and not TupleType: | if request.has_key(cidid): keys = request[cidid] elif request.has_key(id): keys = request[id] else: return None if not type(keys) in (ListType, TupleType): | def _apply_index(self, request, cid=''): """Apply the index to query parameters given in the argument, request | 6daa42b5ad2d6484a816b5497f7df1ae5dae6379 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6daa42b5ad2d6484a816b5497f7df1ae5dae6379/UnIndex.py |
manage_options=({'label':'Join/Leave', 'action':'manage_main'}, {'label':'Properties', 'action':'manage_editForm'}, {'label':'Security', 'action':'manage_access'}, ) | manage_options=( {'label':'Join/Leave', 'action':'manage_main'}, {'label':'Save/Discard', 'action':'manage_end'}, {'label':'Properties', 'action':'manage_editForm'}, {'label':'Security', 'action':'manage_access'}, ) | def manage_addVersion(self, id, title, REQUEST=None): """ """ self=self.this() self._setObject(id, Version(id,title,REQUEST)) if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.absolute_url()+'/manage_main') | dfa721abb02ad6dc74cd93713b66b30539e92c90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dfa721abb02ad6dc74cd93713b66b30539e92c90/Version.py |
('Join/leave Versions', ('enter','leave','leave_another')), ('Save/discard Version changes', ('save','discard')), | ('Join/leave Versions', ('manage_main', 'enter','leave','leave_another')), ('Save/discard Version changes', ('manage_end', 'save','discard')), | def manage_addVersion(self, id, title, REQUEST=None): """ """ self=self.this() self._setObject(id, Version(id,title,REQUEST)) if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.absolute_url()+'/manage_main') | dfa721abb02ad6dc74cd93713b66b30539e92c90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dfa721abb02ad6dc74cd93713b66b30539e92c90/Version.py |
manage=manage_main=Globals.HTMLFile('version', globals()) | manage_main=Globals.HTMLFile('version', globals()) manage_end=Globals.HTMLFile('versionEnd', globals()) | def __init__(self, id, title, REQUEST): self.id=id self.title=title | dfa721abb02ad6dc74cd93713b66b30539e92c90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dfa721abb02ad6dc74cd93713b66b30539e92c90/Version.py |
def discard(self, REQUEST=None): | def discard(self, remark='', REQUEST=None): | def discard(self, REQUEST=None): 'Discard changes made during the version' try: db=self._p_jar.db() except: # BoboPOS 2 Globals.VersionBase[self.cookie].abort() else: # ZODB 3 db.abortVersion(self.cookie) | dfa721abb02ad6dc74cd93713b66b30539e92c90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dfa721abb02ad6dc74cd93713b66b30539e92c90/Version.py |
print 'path', path | def undoable_transactions(self, AUTHENTICATION_PATH=None, first_transaction=None, last_transaction=None, PrincipiaUndoBatchSize=None): | 259a8dcb2ee40acfb0f082f105cdbf262063fca1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/259a8dcb2ee40acfb0f082f105cdbf262063fca1/Undo.py | |
if aq_base(accessed) is aq_base(container): raise Unauthorized, name return 0 | raise Unauthorized, name | def validate(self, accessed, container, name, value, *args): if aq_base(accessed) is aq_base(container): raise Unauthorized, name return 0 | 3e1072c98505121089b41cddfa4af4a4fe2de277 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/3e1072c98505121089b41cddfa4af4a4fe2de277/testTraverse.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.