rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
self.re_static_const = re.compile(r'(\s*)((static\s+.*?|enum\s*\w*\s*{\s*)value\s*=)(.*?)(}?;)$')
self.re_static_const = re.compile(r'(\s*)((BOOST_STATIC_CONSTANT\(\s*\w+,\s*|enum\s*\w*\s*{\s*)value\s*=)(.*?)([}|\)];)$')
self.re_typedef = re.compile(r'^\s+typedef\s+.*?;$')
8373f7b2a6666c9bb3bf966d4dc7a0cc8567d40a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9982/8373f7b2a6666c9bb3bf966d4dc7a0cc8567d40a/pp.py
def process(self, line): if self.reading_copyright: if not self.re_copyright_end.match( line ): self.copyright += line return
8373f7b2a6666c9bb3bf966d4dc7a0cc8567d40a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9982/8373f7b2a6666c9bb3bf966d4dc7a0cc8567d40a/pp.py
line = self.re_assign.sub( r'\1 \2 ', line )
line = self.re_assign.sub( r'\1 \2 \3', line )
def process(self, line): if self.reading_copyright: if not self.re_copyright_end.match( line ): self.copyright += line return
8373f7b2a6666c9bb3bf966d4dc7a0cc8567d40a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9982/8373f7b2a6666c9bb3bf966d4dc7a0cc8567d40a/pp.py
["msvc60", "msvc70", "bcc", "bcc551", "gcc", "mwcw", "no_ctps", "plain"]
["bcc", "bcc551", "gcc", "msvc60", "msvc70", "mwcw", "no_ctps", "no_ttp", "plain"]
def main( all_modes, src_dir, dst_dir ): if len( sys.argv ) < 2: print "\nUsage:\n\t %s <mode> <boost_root> [<source_file>]" % os.path.basename( sys.argv[0] ) print "\nPurpose:\n\t updates preprocessed version(s) of the header(s) in \"%s\" directory" % dst_dir print "\nExample:\n\t the following command will re-generate and update all 'apply.hpp' headers:" print "\n\t\t %s all f:\\cvs\\boost apply.cpp" % os.path.basename( sys.argv[0] ) sys.exit( -1 ) if sys.argv[1] == "all": modes = all_modes else: modes = [sys.argv[1]] boost_root = sys.argv[2] dst_dir = os.path.join( boost_root, dst_dir ) for mode in modes: if len( sys.argv ) > 3: file = os.path.join( os.path.join( os.getcwd(), src_dir ), sys.argv[3] ) process( file, boost_root, dst_dir, mode ) else: process_all( os.path.join( os.getcwd(), src_dir ), boost_root, dst_dir, mode )
b842e1790133bdbe369870bb3a6961857233d425 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9982/b842e1790133bdbe369870bb3a6961857233d425/preprocess.py
atom_counts[ val ] += 1
atom_counts[ int( val ) ] += 1
def run( ts_fnames, out_dir, format, align_count, atom_mapping, mapping, modname, modorder ): samp_size_collapse = 30 samp_size_expand = 10 if mpi: # Startup pypar and get some info about what node we are import pypar nodes = pypar.size() node_id = pypar.rank() print "I am node %d of %d" % ( node_id, nodes ) # Modify these, they get split over nodes samp_size_collapse = samp_size_collapse // nodes samp_size_expand = samp_size_expand // nodes # Open merit output merit_out = open( os.path.join( out_dir, 'merits.txt' ), 'w' ) # Read integer sequences message( "Loading training data" ) training_sets = [] for fname in ts_fnames: strings = [] skipped = 0 for s in rp.io.get_reader( open( fname ), format, None ): # Apply initial mapping s = atom_mapping.translate( s ) # Ensure required columns if sum( s != -1 ) < min_cols: skipped += 1 continue # Add to set strings.append( s ) # Informational message( "Loaded training data from '%s', found %d usable strings and %d skipped" \ % ( fname, len( strings ), skipped ) ) training_sets.append( strings ) # Count how many times each atom appears in the training data, valid # candiates for expansion must occur more than 10 times in the training # data. message( "Finding expandable atoms" ) atom_counts = zeros( atom_mapping.get_out_size() ) for string in chain( * training_sets ): for val in string: atom_counts[ val ] += 1 can_expand = compress( atom_counts > 10, arange( len( atom_counts ) ) ) # Open merit output merit_out = open( os.path.join( out_dir, 'merits.txt' ), 'w' ) best_merit_overall = 0 best_mapping_overall = None index_best_merit_overall = 0 out_counter = 0 step_counter = 0 last_force_counter = 0 message( "Searching" ) # Collapse while 1: clock = time.clock() cv_runs = 0 if mpi: # Sync up nodes at start of each pass pypar.barrier() symbol_count = mapping.get_out_size() best_i = None best_j = None best_merit = 0 best_mapping = None # First try a bunch of collapses if symbol_count > stop_size: # Select some random pairs from the region owned by this node pairs = all_pairs( symbol_count ) if mpi: lo, hi = pypar.balance( len( pairs ), nodes, node_id ) pairs = pairs[lo:hi] if len( pairs ) > samp_size_collapse: pairs = random.sample( pairs, samp_size_collapse ) # Try collapsing each pair for i, j in pairs: new_mapping = mapping.collapse( i, j ) merit = calc_merit( training_sets, new_mapping, modname, modorder ) cv_runs += 1 if merit > best_merit: best_i, best_j = i, j best_merit = merit best_mapping = new_mapping # Also try a bunch of expansions if mpi: lo, hi = pypar.balance( len( can_expand ), nodes, node_id ) elements = random.sample( can_expand[lo:hi], samp_size_expand ) else: elements = random.sample( can_expand, samp_size_expand ) for i in elements: new_mapping = mapping.expand( i ) if new_mapping.get_out_size() == symbol_count: continue merit = calc_merit( training_sets, new_mapping, modname, modorder ) cv_runs += 1 if merit > best_merit: best_i, best_j = i, None best_merit = merit best_mapping = new_mapping clock = time.clock() - clock if mpi: best_i, best_j, best_merit, cv_runs = sync_nodes( best_i, best_j, best_merit, cv_runs ) # Collapse or expand (if j is None) to get the overall best mapping if best_j is None: best_mapping = mapping.expand( best_i ) else: best_mapping = mapping.collapse( best_i, best_j ) mapping = best_mapping # Append merit to merit output if not mpi or node_id == 0: print >>merit_out, step_counter, symbol_count, best_merit merit_out.flush() if best_merit >= best_merit_overall: best_merit_overall = best_merit best_mapping_overall = best_mapping # So we know what step the best mapping was encountered at best_merit_overall_index = step_counter restart_counter = step_counter # Reset the counter we use to force expansions last_force_counter = step_counter # Write best mapping to a file if not mpi or node_id == 0: write_mapping( mapping, os.path.join( out_dir, "%03d.mapping" % out_counter ) ) out_counter += 1 message( "%06d, New best merit: %2.2f%%, size: %d, overall best: %2.2f%% at %06d, cvs/sec: %f" \ % ( step_counter, best_merit * 100, mapping.get_out_size(), best_merit_overall * 100, best_merit_overall_index, cv_runs/clock ) ) # If we have gone 50 steps without improving over the best, restart from best if step_counter > restart_counter + 50: message( "Restarting from best mapping" ) if not mpi or node_id == 0: print >>merit_out, step_counter, "RESTART" mapping = best_mapping_overall restart_counter = step_counter # Immediately force expansions after restart last_force_counter = 0 if step_counter > last_force_counter + 20: last_force_counter = step_counter message( "Forcing expansions" ) if not mpi or node_id == 0: print >>merit_out, step_counter, "FORCED EXPANSIONS" if mpi: lo, hi = pypar.balance( len( can_expand ), nodes, node_id ) my_can_expand = can_expand[lo:hi] else: my_can_expand = can_expand for i in range( 5 ): symbol_count = mapping.get_out_size() best_merit = 0 best_i = None best_mapping = None for i in random.sample( my_can_expand, samp_size_expand ): new_mapping = mapping.expand( i ) if new_mapping.get_out_size() == symbol_count: continue merit = calc_merit( training_sets, new_mapping, modname, modorder ) if merit > best_merit: best_i = i best_merit = merit best_mapping = new_mapping if mpi: best_i, best_j, best_merit, cv_runs = sync_nodes( best_i, None, best_merit, 0 ) assert best_j == None best_mapping = mapping.expand( best_i ) if best_mapping: mapping = best_mapping step_counter += 1
0e6f508b8ad28014969a2ea43ed45e3eddb8b8fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3438/0e6f508b8ad28014969a2ea43ed45e3eddb8b8fd/rp_adapt_mc_mpi.py
main()
main()
def main(): global mpi, fold, passes, loo # Parse command line options, args = cookbook.doc_optparse.parse( __doc__ ) if 1: ts_fnames = args out_dir = options.out align_count, atom_mapping = rp.mapping.alignment_mapping_from_file( file( options.atoms ) ) if options.mapping: mapping = rp.mapping.second_mapping_from_file( file( options.mapping ), atom_mapping ) else: mapping = rp.mapping.identity_mapping( atom_mapping.get_out_size() ) modname = options.model modorder = int( options.order ) if options.fold: fold = int( options.fold ) if options.passes: fold = int( options.passes) loo = bool( options.loo ) mpi = bool( options.mpi ) #except: # cookbook.doc_optparse.exit() run( ts_fnames, out_dir, options.format, align_count, atom_mapping, mapping, modname, modorder )
0e6f508b8ad28014969a2ea43ed45e3eddb8b8fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3438/0e6f508b8ad28014969a2ea43ed45e3eddb8b8fd/rp_adapt_mc_mpi.py
global mpi
global mpi, node_id
def message( *args ): """ Write a message to stderr (but only on the master node if we are using pypar) """ global mpi if not mpi or node_id == 0: sys.stderr.write( ' '.join( map( str, args ) ) ) sys.stderr.write( '\n' ) sys.stderr.flush()
84d927e2bc13764d03587910278d00b95ebf73e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3438/84d927e2bc13764d03587910278d00b95ebf73e8/rp_adapt_mc_mpi.py
import pypar
pypar = __import__( 'pypar' )
def run( ts_fnames, out_dir, format, align_count, atom_mapping, mapping, modname, modorder ): samp_size_collapse = 30 samp_size_expand = 10 if mpi: # Startup pypar and get some info about what node we are import pypar nodes = pypar.size() node_id = pypar.rank() print "I am node %d of %d" % ( node_id, nodes ) # Modify these, they get split over nodes samp_size_collapse = samp_size_collapse // nodes samp_size_expand = samp_size_expand // nodes # Open merit output merit_out = open( os.path.join( out_dir, 'merits.txt' ), 'w' ) # Read integer sequences message( "Loading training data" ) training_sets = [] for fname in ts_fnames: strings = [] skipped = 0 for s in rp.io.get_reader( open( fname ), format, None ): # Apply initial mapping s = atom_mapping.translate( s ) # Ensure required columns if sum( s != -1 ) < min_cols: skipped += 1 continue # Add to set strings.append( s ) # Informational message( "Loaded training data from '%s', found %d usable strings and %d skipped" \ % ( fname, len( strings ), skipped ) ) training_sets.append( strings ) # Count how many times each atom appears in the training data, valid # candiates for expansion must occur more than 10 times in the training # data. message( "Finding expandable atoms" ) atom_counts = zeros( atom_mapping.get_out_size() ) for string in chain( * training_sets ): for val in string: atom_counts[ val ] += 1 can_expand = compress( atom_counts > 10, arange( len( atom_counts ) ) ) # Open merit output merit_out = open( os.path.join( out_dir, 'merits.txt' ), 'w' ) best_merit_overall = 0 best_mapping_overall = None index_best_merit_overall = 0 out_counter = 0 step_counter = 0 last_force_counter = 0 message( "Searching" ) # Collapse while 1: clock = time.clock() cv_runs = 0 if mpi: # Sync up nodes at start of each pass pypar.barrier() symbol_count = mapping.get_out_size() best_i = None best_j = None best_merit = 0 best_mapping = None # First try a bunch of collapses if symbol_count > stop_size: # Select some random pairs from the region owned by this node pairs = all_pairs( symbol_count ) if mpi: lo, hi = pypar.balance( len( pairs ), nodes, node_id ) pairs = pairs[lo:hi] if len( pairs ) > samp_size_collapse: pairs = random.sample( pairs, samp_size_collapse ) # Try collapsing each pair for i, j in pairs: new_mapping = mapping.collapse( i, j ) merit = calc_merit( training_sets, new_mapping, modname, modorder ) cv_runs += 1 if merit > best_merit: best_i, best_j = i, j best_merit = merit best_mapping = new_mapping # Also try a bunch of expansions if mpi: lo, hi = pypar.balance( len( can_expand ), nodes, node_id ) elements = random.sample( can_expand[lo:hi], samp_size_expand ) else: elements = random.sample( can_expand, samp_size_expand ) for i in elements: new_mapping = mapping.expand( i ) if new_mapping.get_out_size() == symbol_count: continue merit = calc_merit( training_sets, new_mapping, modname, modorder ) cv_runs += 1 if merit > best_merit: best_i, best_j = i, None best_merit = merit best_mapping = new_mapping clock = time.clock() - clock if mpi: best_i, best_j, best_merit, cv_runs = sync_nodes( best_i, best_j, best_merit, cv_runs ) # Collapse or expand (if j is None) to get the overall best mapping if best_j is None: best_mapping = mapping.expand( best_i ) else: best_mapping = mapping.collapse( best_i, best_j ) mapping = best_mapping # Append merit to merit output if not mpi or node_id == 0: print >>merit_out, step_counter, symbol_count, best_merit merit_out.flush() if best_merit >= best_merit_overall: best_merit_overall = best_merit best_mapping_overall = best_mapping # So we know what step the best mapping was encountered at best_merit_overall_index = step_counter restart_counter = step_counter # Reset the counter we use to force expansions last_force_counter = step_counter # Write best mapping to a file if not mpi or node_id == 0: write_mapping( mapping, os.path.join( out_dir, "%03d.mapping" % out_counter ) ) out_counter += 1 message( "%06d, New best merit: %2.2f%%, size: %d, overall best: %2.2f%% at %06d, cvs/sec: %f" \ % ( step_counter, best_merit * 100, mapping.get_out_size(), best_merit_overall * 100, best_merit_overall_index, cv_runs/clock ) ) # If we have gone 50 steps without improving over the best, restart from best if step_counter > restart_counter + 50: message( "Restarting from best mapping" ) if not mpi or node_id == 0: print >>merit_out, step_counter, "RESTART" mapping = best_mapping_overall restart_counter = step_counter # Immediately force expansions after restart last_force_counter = 0 if step_counter > last_force_counter + 20: last_force_counter = step_counter message( "Forcing expansions" ) if not mpi or node_id == 0: print >>merit_out, step_counter, "FORCED EXPANSIONS" if mpi: lo, hi = pypar.balance( len( can_expand ), nodes, node_id ) my_can_expand = can_expand[lo:hi] else: my_can_expand = can_expand for i in range( 5 ): symbol_count = mapping.get_out_size() best_merit = 0 best_i = None best_mapping = None for i in random.sample( my_can_expand, samp_size_expand ): new_mapping = mapping.expand( i ) if new_mapping.get_out_size() == symbol_count: continue merit = calc_merit( training_sets, new_mapping, modname, modorder ) if merit > best_merit: best_i = i best_merit = merit best_mapping = new_mapping if mpi: best_i, best_j, best_merit, cv_runs = sync_nodes( best_i, None, best_merit, 0 ) assert best_j == None best_mapping = mapping.expand( best_i ) if best_mapping: mapping = best_mapping step_counter += 1
84d927e2bc13764d03587910278d00b95ebf73e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3438/84d927e2bc13764d03587910278d00b95ebf73e8/rp_adapt_mc_mpi.py
main()
main()
def main(): global mpi, fold, passes, loo # Parse command line options, args = cookbook.doc_optparse.parse( __doc__ ) if 1: ts_fnames = args out_dir = options.out align_count, atom_mapping = rp.mapping.alignment_mapping_from_file( file( options.atoms ) ) if options.mapping: mapping = rp.mapping.second_mapping_from_file( file( options.mapping ), atom_mapping ) else: mapping = rp.mapping.identity_mapping( atom_mapping.get_out_size() ) modname = options.model modorder = int( options.order ) if options.fold: fold = int( options.fold ) if options.passes: fold = int( options.passes) loo = bool( options.loo ) mpi = bool( options.mpi ) #except: # cookbook.doc_optparse.exit() run( ts_fnames, out_dir, options.format, align_count, atom_mapping, mapping, modname, modorder )
84d927e2bc13764d03587910278d00b95ebf73e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3438/84d927e2bc13764d03587910278d00b95ebf73e8/rp_adapt_mc_mpi.py
msg = _(u'Tools successullfy renamed.')
msg = _(u'Tools successfully renamed.')
def update(self): """ """ msg = u'' if "INSTALL-SUBMIT" in self.request: self.install() msg = _(u'Tools successufully installed.') if "UNINSTALL-SUBMIT" in self.request: self.uninstall() msg = _(u'Tools successufully uninstalled.') if "ADD-TOOL-SUBMIT" in self.request: self.action(self.request['type_name'], self.request['id']) elif "CANCEL-ADD-TOOL-SUBMIT" in self.request: self.request.response.expireCookie('SetActiveTool') self.activeTool = None elif "ACTIVATE-SUBMIT" in self.request: self.changeStatus(interfaces.registration.ActiveStatus) msg = _(u'Tools successfully activated.') elif "DEACTIVATE-SUBMIT" in self.request: self.changeStatus(interfaces.registration.InactiveStatus) msg = _(u'Tools successfully deactivated.') elif "ADD-SUBMIT" in self.request: self.addTool = True elif "DELETE-SUBMIT" in self.request: self.delete() elif "RENAME-SUBMIT" in self.request: if 'selected' in self.request: self.renameList = self.request['selected'] if 'new_names' in self.request: self.rename() msg = _(u'Tools successullfy renamed.') elif "RENAME-CANCEL-SUBMIT" in self.request: self.activeTool = None return msg
b5de383a09217c3eabcfdb04aaf665fbba895ea4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/b5de383a09217c3eabcfdb04aaf665fbba895ea4/tools.py
... if path.startswith('zope.app.layers') and \ ... hasattr(layers, 'layer1') or \ ... path == 'zope.app.component.fields.layer1':
... if '..' in path: ... raise ValueError('Empty module name') ... if (path.startswith('zope.app.layers') and ... hasattr(layers, 'layer1') or ... path == 'zope.app.component.fields.layer1' or ... path == '.fields.layer1'):
... def resolve(self, path):
2665ccde6762e8e9f3d2744fb795f9c4c2d125e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/2665ccde6762e8e9f3d2744fb795f9c4c2d125e1/fields.py
... def resolve(self, path):
2665ccde6762e8e9f3d2744fb795f9c4c2d125e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/2665ccde6762e8e9f3d2744fb795f9c4c2d125e1/fields.py
else:
else:
def fromUnicode(self, u): name = str(u.strip())
2665ccde6762e8e9f3d2744fb795f9c4c2d125e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/2665ccde6762e8e9f3d2744fb795f9c4c2d125e1/fields.py
except ConfigurationError, v:
except (ConfigurationError, ValueError), v:
def fromUnicode(self, u): name = str(u.strip())
2665ccde6762e8e9f3d2744fb795f9c4c2d125e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/2665ccde6762e8e9f3d2744fb795f9c4c2d125e1/fields.py
def fromUnicode(self, u): name = str(u.strip())
2665ccde6762e8e9f3d2744fb795f9c4c2d125e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/2665ccde6762e8e9f3d2744fb795f9c4c2d125e1/fields.py
class SiteManagementView(adding.Adding):
class SiteManagementView(browser.ComponentAdding):
def __init__(self, interface, title, description=None, unique=False, folder='tools'): self.interface = interface self.title = title self.description = description self.unique = unique self.folder = folder
32b5ff151b15d38e122f0ad7d5cbaaf1eef165c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/32b5ff151b15d38e122f0ad7d5cbaaf1eef165c4/tools.py
regManager = self.context[tool.folder].registrationManager
regManager = self.getSiteManagementFolder(tool).registrationManager
def getToolInstances(self, tool): """Find every registered utility for a given tool configuration.""" regManager = self.context[tool.folder].registrationManager return [ {'name': reg.name, 'url': zapi.absoluteURL(reg.component, self.request), 'rename': tool is self.activeTool and reg.name in self.renameList, 'active': reg.status == u'Active' } for reg in regManager.values() if (zapi.isinstance(reg, site.UtilityRegistration) and reg.provided.isOrExtends(tool.interface))]
32b5ff151b15d38e122f0ad7d5cbaaf1eef165c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/32b5ff151b15d38e122f0ad7d5cbaaf1eef165c4/tools.py
for iface in for_: if iface is not None: _context.action( discriminator = None, callable = provideInterface, args = ('', iface) )
_context.action( discriminator = None, callable = provideInterface, args = ('', for_) )
def defaultView(_context, type, name, for_): _context.action( discriminator = ('defaultViewName', for_, type, name), callable = handler, args = (zapi.servicenames.Adapters, 'register', (for_, type), IDefaultViewName, '', name, _context.info) ) _context.action( discriminator = None, callable = provideInterface, args = ('', type) ) for iface in for_: if iface is not None: _context.action( discriminator = None, callable = provideInterface, args = ('', iface) )
ddf557d81439cbd594f1e94302f57bb52f2a1741 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/ddf557d81439cbd594f1e94302f57bb52f2a1741/metaconfigure.py
siteinfo.services = None
services = serviceManager
def setSite(site=None): if site is None: siteinfo.services = None else: siteinfo.services = trustedRemoveSecurityProxy(site.getSiteManager())
089a2c68062c62dbb55265c37ff271b69ba41642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/089a2c68062c62dbb55265c37ff271b69ba41642/hooks.py
siteinfo.services = trustedRemoveSecurityProxy(site.getSiteManager())
site = trustedRemoveSecurityProxy(site) services = site.getSiteManager()
def setSite(site=None): if site is None: siteinfo.services = None else: siteinfo.services = trustedRemoveSecurityProxy(site.getSiteManager())
089a2c68062c62dbb55265c37ff271b69ba41642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/089a2c68062c62dbb55265c37ff271b69ba41642/hooks.py
try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return None return services.__parent__
return siteinfo.site
def getSite(): try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return None return services.__parent__
089a2c68062c62dbb55265c37ff271b69ba41642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/089a2c68062c62dbb55265c37ff271b69ba41642/hooks.py
def getSite(): try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return None return services.__parent__
089a2c68062c62dbb55265c37ff271b69ba41642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/089a2c68062c62dbb55265c37ff271b69ba41642/hooks.py
try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return serviceManager return services
return siteinfo.services
def getServices_hook(context=None): if context is None: try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return serviceManager return services # Deprecated support for a context that isn't adaptable to # IServiceService. Return the default service manager. try: return trustedRemoveSecurityProxy(IServiceService(context, serviceManager)) except ComponentLookupError: return serviceManager
089a2c68062c62dbb55265c37ff271b69ba41642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/089a2c68062c62dbb55265c37ff271b69ba41642/hooks.py
def getServices_hook(context=None): if context is None: try: services = siteinfo.services except AttributeError: services = siteinfo.services = None if services is None: return serviceManager return services # Deprecated support for a context that isn't adaptable to # IServiceService. Return the default service manager. try: return trustedRemoveSecurityProxy(IServiceService(context, serviceManager)) except ComponentLookupError: return serviceManager
089a2c68062c62dbb55265c37ff271b69ba41642 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/089a2c68062c62dbb55265c37ff271b69ba41642/hooks.py
return interfaces.ActiveStatus return interfaces.InactiveStatus
return ActiveStatus return InactiveStatus
def __get__(self, inst, klass): registration = inst if registration is None: return self
7e5cbe1942b8f9364be5de8c9301955e1d09f59d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/7e5cbe1942b8f9364be5de8c9301955e1d09f59d/back35.py
if value == interfaces.ActiveStatus:
if value == ActiveStatus:
def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.')
7e5cbe1942b8f9364be5de8c9301955e1d09f59d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/7e5cbe1942b8f9364be5de8c9301955e1d09f59d/back35.py
elif value == interfaces.InactiveStatus:
elif value == InactiveStatus:
def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.')
7e5cbe1942b8f9364be5de8c9301955e1d09f59d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/7e5cbe1942b8f9364be5de8c9301955e1d09f59d/back35.py
if (interfaces.IComponentRegistration.providedBy(reg) and
if (IComponentRegistration.providedBy(reg) and
def registrations(self): rm = zapi.getParent(self.registerable).registrationManager return [reg for reg in rm.values() if (interfaces.IComponentRegistration.providedBy(reg) and reg.component is self.registerable)]
7e5cbe1942b8f9364be5de8c9301955e1d09f59d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/7e5cbe1942b8f9364be5de8c9301955e1d09f59d/back35.py
>>> interfaces
>>> list(interfaces)
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces import IInterface >>> from zope.app.content.interfaces import IContentType >>> class I(Interface): ... pass >>> IInterface.providedBy(I) True >>> IContentType.providedBy(I) False >>> interfaces = utilities.getUtilitiesFor(IContentType) >>> interfaces [] >>> provideInterface('', I, IContentType) >>> IContentType.providedBy(I) True >>> interfaces = utilities.getUtilitiesFor(IContentType) >>> [name for (name, iface) in interfaces] ['zope.app.component.interface.I'] >>> [iface.__name__ for (name, iface) in interfaces] ['I'] >>> class I1(Interface): ... pass >>> provideInterface('', I1) >>> IInterface.providedBy(I1) True >>> IContentType.providedBy(I1) False >>> interfaces1 = utilities.getUtilitiesFor(IContentType) >>> [name for (name, iface) in interfaces] ['zope.app.component.interface.I'] >>> [iface.__name__ for (name, iface) in interfaces] ['I'] >>> tearDown() """ if not id: id = "%s.%s" % (interface.__module__, interface.__name__) if not IInterface.providedBy(interface): if not isinstance(interface, (type, ClassType)): raise TypeError(id, "is not an interface or class") return if iface_type is not None: if not iface_type.extends(IInterface): raise TypeError(iface_type, "is not an interface type") directlyProvides(interface, iface_type) else: iface_type = IInterface utilityService = zapi.getService(None, zapi.servicenames.Utilities) utilityService.provideUtility(iface_type, interface, name=id)
ab7b724336ad45169dfaa66cb33bd11ac217f761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/ab7b724336ad45169dfaa66cb33bd11ac217f761/interface.py
>>> interfaces = utilities.getUtilitiesFor(IContentType)
>>> interfaces = list(utilities.getUtilitiesFor(IContentType))
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces import IInterface >>> from zope.app.content.interfaces import IContentType >>> class I(Interface): ... pass >>> IInterface.providedBy(I) True >>> IContentType.providedBy(I) False >>> interfaces = utilities.getUtilitiesFor(IContentType) >>> interfaces [] >>> provideInterface('', I, IContentType) >>> IContentType.providedBy(I) True >>> interfaces = utilities.getUtilitiesFor(IContentType) >>> [name for (name, iface) in interfaces] ['zope.app.component.interface.I'] >>> [iface.__name__ for (name, iface) in interfaces] ['I'] >>> class I1(Interface): ... pass >>> provideInterface('', I1) >>> IInterface.providedBy(I1) True >>> IContentType.providedBy(I1) False >>> interfaces1 = utilities.getUtilitiesFor(IContentType) >>> [name for (name, iface) in interfaces] ['zope.app.component.interface.I'] >>> [iface.__name__ for (name, iface) in interfaces] ['I'] >>> tearDown() """ if not id: id = "%s.%s" % (interface.__module__, interface.__name__) if not IInterface.providedBy(interface): if not isinstance(interface, (type, ClassType)): raise TypeError(id, "is not an interface or class") return if iface_type is not None: if not iface_type.extends(IInterface): raise TypeError(iface_type, "is not an interface type") directlyProvides(interface, iface_type) else: iface_type = IInterface utilityService = zapi.getService(None, zapi.servicenames.Utilities) utilityService.provideUtility(iface_type, interface, name=id)
ab7b724336ad45169dfaa66cb33bd11ac217f761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/ab7b724336ad45169dfaa66cb33bd11ac217f761/interface.py
['zope.app.component.interface.I']
[u'zope.app.component.interface.I']
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces import IInterface >>> from zope.app.content.interfaces import IContentType >>> class I(Interface): ... pass >>> IInterface.providedBy(I) True >>> IContentType.providedBy(I) False >>> interfaces = utilities.getUtilitiesFor(IContentType) >>> interfaces [] >>> provideInterface('', I, IContentType) >>> IContentType.providedBy(I) True >>> interfaces = utilities.getUtilitiesFor(IContentType) >>> [name for (name, iface) in interfaces] ['zope.app.component.interface.I'] >>> [iface.__name__ for (name, iface) in interfaces] ['I'] >>> class I1(Interface): ... pass >>> provideInterface('', I1) >>> IInterface.providedBy(I1) True >>> IContentType.providedBy(I1) False >>> interfaces1 = utilities.getUtilitiesFor(IContentType) >>> [name for (name, iface) in interfaces] ['zope.app.component.interface.I'] >>> [iface.__name__ for (name, iface) in interfaces] ['I'] >>> tearDown() """ if not id: id = "%s.%s" % (interface.__module__, interface.__name__) if not IInterface.providedBy(interface): if not isinstance(interface, (type, ClassType)): raise TypeError(id, "is not an interface or class") return if iface_type is not None: if not iface_type.extends(IInterface): raise TypeError(iface_type, "is not an interface type") directlyProvides(interface, iface_type) else: iface_type = IInterface utilityService = zapi.getService(None, zapi.servicenames.Utilities) utilityService.provideUtility(iface_type, interface, name=id)
ab7b724336ad45169dfaa66cb33bd11ac217f761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/ab7b724336ad45169dfaa66cb33bd11ac217f761/interface.py
>>> interfaces1 = utilities.getUtilitiesFor(IContentType)
>>> interfaces = list(utilities.getUtilitiesFor(IContentType))
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces import IInterface >>> from zope.app.content.interfaces import IContentType >>> class I(Interface): ... pass >>> IInterface.providedBy(I) True >>> IContentType.providedBy(I) False >>> interfaces = utilities.getUtilitiesFor(IContentType) >>> interfaces [] >>> provideInterface('', I, IContentType) >>> IContentType.providedBy(I) True >>> interfaces = utilities.getUtilitiesFor(IContentType) >>> [name for (name, iface) in interfaces] ['zope.app.component.interface.I'] >>> [iface.__name__ for (name, iface) in interfaces] ['I'] >>> class I1(Interface): ... pass >>> provideInterface('', I1) >>> IInterface.providedBy(I1) True >>> IContentType.providedBy(I1) False >>> interfaces1 = utilities.getUtilitiesFor(IContentType) >>> [name for (name, iface) in interfaces] ['zope.app.component.interface.I'] >>> [iface.__name__ for (name, iface) in interfaces] ['I'] >>> tearDown() """ if not id: id = "%s.%s" % (interface.__module__, interface.__name__) if not IInterface.providedBy(interface): if not isinstance(interface, (type, ClassType)): raise TypeError(id, "is not an interface or class") return if iface_type is not None: if not iface_type.extends(IInterface): raise TypeError(iface_type, "is not an interface type") directlyProvides(interface, iface_type) else: iface_type = IInterface utilityService = zapi.getService(None, zapi.servicenames.Utilities) utilityService.provideUtility(iface_type, interface, name=id)
ab7b724336ad45169dfaa66cb33bd11ac217f761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/ab7b724336ad45169dfaa66cb33bd11ac217f761/interface.py
['zope.app.component.interface.I']
[u'zope.app.component.interface.I']
def provideInterface(id, interface, iface_type=None): """register Interface with utility service >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces import IInterface >>> from zope.app.content.interfaces import IContentType >>> class I(Interface): ... pass >>> IInterface.providedBy(I) True >>> IContentType.providedBy(I) False >>> interfaces = utilities.getUtilitiesFor(IContentType) >>> interfaces [] >>> provideInterface('', I, IContentType) >>> IContentType.providedBy(I) True >>> interfaces = utilities.getUtilitiesFor(IContentType) >>> [name for (name, iface) in interfaces] ['zope.app.component.interface.I'] >>> [iface.__name__ for (name, iface) in interfaces] ['I'] >>> class I1(Interface): ... pass >>> provideInterface('', I1) >>> IInterface.providedBy(I1) True >>> IContentType.providedBy(I1) False >>> interfaces1 = utilities.getUtilitiesFor(IContentType) >>> [name for (name, iface) in interfaces] ['zope.app.component.interface.I'] >>> [iface.__name__ for (name, iface) in interfaces] ['I'] >>> tearDown() """ if not id: id = "%s.%s" % (interface.__module__, interface.__name__) if not IInterface.providedBy(interface): if not isinstance(interface, (type, ClassType)): raise TypeError(id, "is not an interface or class") return if iface_type is not None: if not iface_type.extends(IInterface): raise TypeError(iface_type, "is not an interface type") directlyProvides(interface, iface_type) else: iface_type = IInterface utilityService = zapi.getService(None, zapi.servicenames.Utilities) utilityService.provideUtility(iface_type, interface, name=id)
ab7b724336ad45169dfaa66cb33bd11ac217f761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/ab7b724336ad45169dfaa66cb33bd11ac217f761/interface.py
['zope.app.component.interface.I5']
[u'zope.app.component.interface.I5']
def searchInterfaceIds(context, search_string=None, base=None): """Interfaces search >>> from zope.app.tests.placelesssetup import setUp, tearDown >>> setUp() >>> utilities = zapi.getService(None, zapi.servicenames.Utilities) >>> from zope.interface import Interface >>> from zope.interface.interfaces import IInterface >>> from zope.app.content.interfaces import IContentType >>> class I5(Interface): ... pass >>> IInterface.providedBy(I5) True >>> IContentType.providedBy(I5) False >>> searchInterface(None, 'zope.app.component.interface.I5') [] >>> provideInterface('', I5, IContentType) >>> IContentType.providedBy(I5) True >>> iface = searchInterfaceIds(None, ... 'zope.app.component.interface.I5') >>> iface ['zope.app.component.interface.I5'] >>> tearDown() """ return [iface_util[0] for iface_util in searchInterfaceUtilities(context, search_string, base)]
ab7b724336ad45169dfaa66cb33bd11ac217f761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/ab7b724336ad45169dfaa66cb33bd11ac217f761/interface.py
away in Zope 3.6. There is no replacement for this function, since it odes not
away in Zope 3.6. There is no replacement for this function, since it does not
def getNextSiteManager(context): """Get the next site manager.""" sm = queryNextSiteManager(context, _marker) if sm is _marker: raise zope.component.interfaces.ComponentLookupError( "No more site managers have been found.") return sm
0cfad844a4d6de1b7547c9bdba98429d54f8b5bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/0cfad844a4d6de1b7547c9bdba98429d54f8b5bf/__init__.py
rootFolder = Place('')
rootFolder = Place(u'')
def __get__(self, inst, cls=None): if inst is None: return self
0561c517ec32874126d4958f808c90f6b1e3f174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/0561c517ec32874126d4958f808c90f6b1e3f174/testing.py
folder1 = Place('folder1') folder1_1 = Place('folder1/folder1_1') folder1_1_1 = Place('folder1/folder1_1/folder1_1_1') folder1_1_2 = Place('folder1/folder1_2/folder1_1_2') folder1_2 = Place('folder1/folder1_2') folder1_2_1 = Place('folder1/folder1_2/folder1_2_1')
folder1 = Place(u'folder1') folder1_1 = Place(u'folder1/folder1_1') folder1_1_1 = Place(u'folder1/folder1_1/folder1_1_1') folder1_1_2 = Place(u'folder1/folder1_2/folder1_1_2') folder1_2 = Place(u'folder1/folder1_2') folder1_2_1 = Place(u'folder1/folder1_2/folder1_2_1')
def __get__(self, inst, cls=None): if inst is None: return self
0561c517ec32874126d4958f808c90f6b1e3f174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/0561c517ec32874126d4958f808c90f6b1e3f174/testing.py
folder2 = Place('folder2') folder2_1 = Place('folder2/folder2_1') folder2_1_1 = Place('folder2/folder2_1/folder2_1_1')
folder2 = Place(u'folder2') folder2_1 = Place(u'folder2/folder2_1') folder2_1_1 = Place(u'folder2/folder2_1/folder2_1_1')
def __get__(self, inst, cls=None): if inst is None: return self
0561c517ec32874126d4958f808c90f6b1e3f174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/0561c517ec32874126d4958f808c90f6b1e3f174/testing.py
>>> old = sys.modules.get('zope.app.layers', None)
>>> import zope.app.layers >>> old = sys.modules['zope.app.layers']
... def resolve(self, path):
0437228b54d73af25b4a383d5609ee2c3d4b1fad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/0437228b54d73af25b4a383d5609ee2c3d4b1fad/back35.py
>>> if old is not None: ... sys.modules['zope.app.layers'] = old
>>> sys.modules['zope.app.layers'] = old
... def resolve(self, path):
0437228b54d73af25b4a383d5609ee2c3d4b1fad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/0437228b54d73af25b4a383d5609ee2c3d4b1fad/back35.py
"""
'''
def testServiceConfigNoType(self): from zope.component.service \ import UndefinedService self.assertRaises( UndefinedService, xmlconfig, StringIO(template % ( """ <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> """ )))
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> """
serviceType="Foo" component="zope.app.component.tests.service.fooService" /> '''
def testServiceConfigNoType(self): from zope.component.service \ import UndefinedService self.assertRaises( UndefinedService, xmlconfig, StringIO(template % ( """ <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> """ )))
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
""" <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" />
''' <serviceType id="Foo" interface="zope.app.component.tests.service.IFooService" />
def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.foo2" /> """ )))
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
component=" zope.app.component.tests.service.fooService"
component="zope.app.component.tests.service.fooService"
def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.foo2" /> """ )))
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
component=" zope.app.component.tests.service.foo2"
component="zope.app.component.tests.service.foo2"
def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.foo2" /> """ )))
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
"""
'''
def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.foo2" /> """ )))
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
""" <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" />
''' <serviceType id="Foo" interface="zope.app.component.tests.service.IFooService" />
def testServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo")
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> """
serviceType="Foo" component="zope.app.component.tests.service.fooService" /> '''
def testServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo")
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
""" <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" />
''' <serviceType id="Foo" interface="zope.app.component.tests.service.IFooService" />
def testServiceFactoryConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo")
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
serviceType="Foo" factory=" zope.app.component.tests.service.FooService" /> """
serviceType="Foo" factory="zope.app.component.tests.service.FooService" /> '''
def testServiceFactoryConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo")
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
""" <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" />
''' <serviceType id="Foo" interface="zope.app.component.tests.service.IFooService" />
def testPublicProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo")
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
serviceType="Foo" component=" zope.app.component.tests.service.fooService" permission="zope.Public" /> """
serviceType="Foo" component="zope.app.component.tests.service.fooService" permission="zope.Public" /> '''
def testPublicProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo")
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
""" <directives namespace="http://namespaces.zope.org/zope"> <directive name="permission" attributes="id title description" handler=" zope.app.security.metaconfigure.definePermission" /> </directives>
''' <include package="zope.app.security" file="meta.zcml" />
def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo")
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
<serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" />
<serviceType id="Foo" interface="zope.app.component.tests.service.IFooService" />
def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo")
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
serviceType="Foo" component=" zope.app.component.tests.service.fooService" permission="zope.TestPermission" /> """
serviceType="Foo" component="zope.app.component.tests.service.fooService" permission="zope.TestPermission" /> '''
def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo")
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
def testProtectedServiceConfig(self): self.assertRaises(ComponentLookupError, getService, "Foo")
f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py
implements(interfaces.IRegistration, interfaces.IRegistrationManagerContained)
implements(IRegistration, IRegistrationManagerContained)
def __set__(self, inst, value): registration = inst registry = registration.getRegistry() if registry is None: raise ValueError('No registry found.')
381b6e5917e869bb1e93e4558613edde1b72615f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/381b6e5917e869bb1e93e4558613edde1b72615f/back35.py
implements(interfaces.IComponentRegistration)
implements(IComponentRegistration)
def __setstate__(self, dict): super(BBBComponentRegistration, self).__setstate__(dict) # For some reason the component path is not set correctly by the # default __setstate__ mechanism. if 'componentPath' in dict: self._component = NULL_COMPONENT self._BBB_componentPath = dict['componentPath']
381b6e5917e869bb1e93e4558613edde1b72615f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/381b6e5917e869bb1e93e4558613edde1b72615f/back35.py
implements(interfaces.IRegistered) __used_for__ = interfaces.IRegisterable
implements(IRegistered) __used_for__ = IRegisterable
def _setComponent(self, component): # We always want to set the plain component. Untrusted code will # get back a proxied component anyways. self._component = removeSecurityProxy(component)
381b6e5917e869bb1e93e4558613edde1b72615f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/381b6e5917e869bb1e93e4558613edde1b72615f/back35.py
implements(interfaces.IRegistrationManager)
implements(IRegistrationManager)
def registrations(self): rm = zapi.getParent(self.registerable).registrationManager return [reg for reg in rm.values() if (interfaces.IComponentRegistration.providedBy(reg) and reg.component is self.registerable)]
381b6e5917e869bb1e93e4558613edde1b72615f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/381b6e5917e869bb1e93e4558613edde1b72615f/back35.py
__used_for__ = interfaces.IRegisterableContainer
__used_for__ = IRegisterableContainer
def __createRegistrationManager(self): "Create a registration manager and store it as `registrationManager`" # See interfaces.IRegisterableContainer self.registrationManager = RegistrationManager() self.registrationManager.__parent__ = self self.registrationManager.__name__ = '++registrations++' zope.event.notify( objectevent.ObjectCreatedEvent(self.registrationManager))
381b6e5917e869bb1e93e4558613edde1b72615f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/381b6e5917e869bb1e93e4558613edde1b72615f/back35.py
_context.action( discriminator = None, callable = provideInterface, args = (type.__module__+'.'+type.__name__, type) ) _context.action( discriminator = None, callable = provideInterface, args = (provides.__module__+'.'+provides.__name__, type) )
if type is not None: _context.action( discriminator = None, callable = provideInterface, args = ('', type) ) _context.action( discriminator = None, callable = provideInterface, args = ('', provides) )
def factory(ob, request): for f in factories[:-1]: ob = f(ob) return factories[-1](ob, request)
04287fa6725d60f3cee334b55546e4efb6d8c27d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/04287fa6725d60f3cee334b55546e4efb6d8c27d/metaconfigure.py
value = self.context.resolve(name)
value = self.context.resolve('zope.app.layers.'+name)
def fromUnicode(self, u): name = str(u.strip())
0219ee36ae434c5ba31e58e1596b147fa53934a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/0219ee36ae434c5ba31e58e1596b147fa53934a2/fields.py
name = 'zope.app.layers.'+name
def fromUnicode(self, u): name = str(u.strip())
0219ee36ae434c5ba31e58e1596b147fa53934a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/0219ee36ae434c5ba31e58e1596b147fa53934a2/fields.py
zope.component.getServices.sethook(getServices_hook)
def getServices_hook(context=None): if context is None: return siteinfo.services # Deprecated support for a context that isn't adaptable to # IServiceService. Return the default service manager. try: return trustedRemoveSecurityProxy(IServiceService(context, serviceManager)) except ComponentLookupError: return serviceManager
9a946a6be008892c2742d587d28ebcd07907a914 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/9a946a6be008892c2742d587d28ebcd07907a914/hooks.py
zope.component.adapter_hook.sethook(adapter_hook)
def adapter_hook(interface, object, name='', default=None): try: return siteinfo.adapter_hook(interface, object, name, default) except ComponentLookupError: return default
9a946a6be008892c2742d587d28ebcd07907a914 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/9a946a6be008892c2742d587d28ebcd07907a914/hooks.py
zope.component.queryView.sethook(queryView)
def setHooks(): zope.component.getServices.sethook(getServices_hook) zope.component.adapter_hook.sethook(adapter_hook) zope.component.queryView.sethook(queryView) def resetHooks(): zope.component.getServices.reset() zope.component.adapter_hook.reset() zope.component.queryView.reset()
def queryView(object, name, request, default=None, providing=Interface, context=None): views = getService(Presentation, context) view = views.queryView(object, name, request, default=default, providing=providing) if ILocation.providedBy(view): locate(view, object, name) return view
9a946a6be008892c2742d587d28ebcd07907a914 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/9a946a6be008892c2742d587d28ebcd07907a914/hooks.py
def proxyView(context, request, factory=factory[-1], checker=checker): return proxify(factory(context, request), checker) proxyView.factory = factory[-1] factory[-1] = proxyView
class ProxyView(object): """Class to create simple proxy views.""" def __init__(self, factory, checker): self.factory = factory self.checker = checker def __call__(self, *objects): return proxify(self.factory(*objects), self.checker) factory[-1] = ProxyView(factory[-1], checker)
def proxyView(context, request, factory=factory[-1], checker=checker): return proxify(factory(context, request), checker)
effbacd2a6489aaed03028947c10b315dab17d6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/effbacd2a6489aaed03028947c10b315dab17d6c/metaconfigure.py
from zope.app.services.service \
from zope.app.services.servicecontainer \
def makeTestObject(self): from zope.app.services.service \ import ServiceManagerContainer return ServiceManagerContainer()
d680c1eef8882207e48c33dfe12efd32aeba9c39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/d680c1eef8882207e48c33dfe12efd32aeba9c39/test_servicemanagercontainer.py
if permission == 'Zope.Public':
if permission == 'zope.Public':
def utility(_context, provides, component=None, factory=None, permission=None, name=''): provides = _context.resolve(provides) if factory: if component: raise TypeError("Can't specify factory and component.") component = _context.resolve(factory)() else: component = _context.resolve(component) if permission is not None: if permission == 'Zope.Public': permission = CheckerPublic checker = InterfaceChecker(provides, permission) component = Proxy(component, checker) return [ Action( discriminator = ('utility', provides, name), callable = checkingHandler, args = (permission, 'Utilities', 'provideUtility', provides, component, name), ), Action( discriminator = None, callable = handler, args = ('Interfaces', 'provideInterface', provides.__module__+'.'+provides.__name__, provides) ) ]
f59157e61ae391a5acf9f75511a9d6ae2fb0bef4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f59157e61ae391a5acf9f75511a9d6ae2fb0bef4/metaconfigure.py
def setHooks(): zope.component.adapter_hook.sethook(adapter_hook) zope.component.getSiteManager.sethook(getSiteManager) # Goes away in 3.3. zope.deprecation.__show__.off() from bbb import hooks zope.component.getServices.sethook(hooks.getServices_hook) zope.deprecation.__show__.on()
360f3d6b62bfe87215e91df4354cdab8eff19bad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/360f3d6b62bfe87215e91df4354cdab8eff19bad/hooks.py
def searchInterface(self, search_string=None, base=None): return [t[1] for t in self.items(search_string, base)]
d6e92e7edee6f781d9f2a2d59faf6aabf9a4334c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/d6e92e7edee6f781d9f2a2d59faf6aabf9a4334c/globalinterfaceservice.py
def items(self, search_string=None, base=None): if search_string: search_string = search_string.lower() for id, (interface, doc) in self.__data.items(): if search_string: if doc.find(search_string) < 0: continue if base is not None and not interface.extends(base, 0): continue yield id, interface
d6e92e7edee6f781d9f2a2d59faf6aabf9a4334c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/d6e92e7edee6f781d9f2a2d59faf6aabf9a4334c/globalinterfaceservice.py
def reduce_factories(factories, for_):
def adapter(_context, factory, provides, for_, permission=None, name=''): if permission is not None: if permission == PublicPermission: permission = CheckerPublic checker = InterfaceChecker(provides, permission) factory.append(lambda c: proxify(c, checker)) for_ = tuple(for_) factories = factory
def reduce_factories(factories, for_): if len(factories) == 1: factory = factories[0] elif len(factories) < 1: raise ValueError("No factory specified") elif len(factories) > 1 and len(for_) > 1: raise ValueError("Can't use multiple factories and multiple for") else: def factory(ob): for f in factories: ob = f(ob) return ob return factory
aa7adf06e408affb776189758679dd6527424c57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/aa7adf06e408affb776189758679dd6527424c57/metaconfigure.py
elif len(factories) > 1 and len(for_) > 1:
elif len(factories) > 1 and len(for_) != 1:
def reduce_factories(factories, for_): if len(factories) == 1: factory = factories[0] elif len(factories) < 1: raise ValueError("No factory specified") elif len(factories) > 1 and len(for_) > 1: raise ValueError("Can't use multiple factories and multiple for") else: def factory(ob): for f in factories: ob = f(ob) return ob return factory
aa7adf06e408affb776189758679dd6527424c57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/aa7adf06e408affb776189758679dd6527424c57/metaconfigure.py
return factory def adapter(_context, factory, provides, for_, permission=None, name=''): if permission is not None: if permission == PublicPermission: permission = CheckerPublic checker = InterfaceChecker(provides, permission) factory.append(lambda c: proxify(c, checker)) for_ = tuple(for_)
def factory(ob): for f in factories: ob = f(ob) return ob
aa7adf06e408affb776189758679dd6527424c57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/aa7adf06e408affb776189758679dd6527424c57/metaconfigure.py
for_, provides, name, reduce_factories(factory, for_)),
for_, provides, name, factory),
def adapter(_context, factory, provides, for_, permission=None, name=''): if permission is not None: if permission == PublicPermission: permission = CheckerPublic checker = InterfaceChecker(provides, permission) factory.append(lambda c: proxify(c, checker)) for_ = tuple(for_) _context.action( discriminator = ('adapter', for_, provides, name), callable = checkingHandler, args = (permission, Adapters, 'register', for_, provides, name, reduce_factories(factory, for_)), ) _context.action( discriminator = None, callable = provideInterface, args = ('', provides) ) if for_: for iface in for_: if iface is not None: _context.action( discriminator = None, callable = provideInterface, args = ('', iface) )
aa7adf06e408affb776189758679dd6527424c57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/aa7adf06e408affb776189758679dd6527424c57/metaconfigure.py
type, reduce_factories(factory, for_), name, for_, provides, layer),
type, factory, name, for_, provides, layer),
def proxyView(context, request, factory=factory[-1], checker=checker): return proxify(factory(context, request), checker)
aa7adf06e408affb776189758679dd6527424c57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/aa7adf06e408affb776189758679dd6527424c57/metaconfigure.py
"""Require a the permission to access a specific aspect"""
"""Require a permission to access a specific aspect"""
def require(self, _context, permission=None, attributes=None, interface=None, like_class=None, set_attributes=None, set_schema=None): """Require a the permission to access a specific aspect""" if like_class: self.__mimic(_context, like_class)
e346459c4070d43290b2320c09a4e32e839addcd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/e346459c4070d43290b2320c09a4e32e839addcd/contentdirective.py
)
)
def __init__(self, *args, **kw): warnings.warn( "Use of `ComponentPathWidget` deprecated, since the " "registration code now uses the component directly instead " "of using the component's path.", DeprecationWarning, stacklevel=2, ) super(ComponentPathWidget, self).__init__(*args, **kw)
25e37d6ea3664a393c525e00024fe12ad67b0862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/25e37d6ea3664a393c525e00024fe12ad67b0862/registration.py
"""Remove the directives from the container."""
"""Unregister and remove the directives from the container."""
def remove_objects(self, key_list): """Remove the directives from the container.""" container = self.context for name in key_list: del container[name]
25e37d6ea3664a393c525e00024fe12ad67b0862 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/25e37d6ea3664a393c525e00024fe12ad67b0862/registration.py
def ignorewarning(message, category, filename, lineno, file=None): pass warnings.showwarning = ignorewarning
showwarning = warnings.showwarning warnings.showwarning = lambda *a, **k: None
def ignorewarning(message, category, filename, lineno, file=None): pass
f639b502c07f40c76dc29c089e844e9e9ef7fc25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f639b502c07f40c76dc29c089e844e9e9ef7fc25/test_directives.py
warnings.resetwarnings()
warnings.showwarning = showwarning
def ignorewarning(message, category, filename, lineno, file=None): pass
f639b502c07f40c76dc29c089e844e9e9ef7fc25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f639b502c07f40c76dc29c089e844e9e9ef7fc25/test_directives.py
raise TypeError("No factory or handler provides")
raise TypeError("No factory or handler provided")
def subscriber(_context, for_=None, factory=None, handler=None, provides=None, permission=None, trusted=False): if factory is None: if handler is None: raise TypeError("No factory or handler provides") if provides is not None: raise TypeError("Cannot use handler with provides") factory = handler else: if handler is not None: raise TypeError("Cannot use handler with factory") if provides is None: import warnings warnings.warn( "Use of factory without provides to indicate a handler " "is deprecated and will change it's meaning in Zope X3.3. " "Use the handler attribute instead.", DeprecationWarning) if for_ is None: for_ = component.adaptedBy(factory) if for_ is None: raise TypeError("No for attribute was provided and can't " "determine what the factory (or handler) adapts.") factory = [factory] if permission is not None: if permission == PublicPermission: permission = CheckerPublic checker = InterfaceChecker(provides, permission) factory.append(lambda c: proxify(c, checker)) for_ = tuple(for_) # Generate a single factory from multiple factories: factories = factory if len(factories) == 1: factory = factories[0] elif len(factories) < 1: raise ValueError("No factory specified") elif len(factories) > 1 and len(for_) != 1: raise ValueError("Can't use multiple factories and multiple for") else: def factory(ob): for f in factories: ob = f(ob) return ob if trusted: factory = TrustedAdapterFactory(factory) _context.action( discriminator = None, callable = _handler, args = ('subscribe', for_, provides, factory), ) if provides is not None: _context.action( discriminator = None, callable = provideInterface, args = ('', provides) ) # For each interface, state that the adapter provides that interface. for iface in for_: if iface is not None: _context.action( discriminator = None, callable = provideInterface, args = ('', iface) )
15259c6e0dd74e1c9d0274e86e264fdefd64fcd1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/15259c6e0dd74e1c9d0274e86e264fdefd64fcd1/metaconfigure.py
return '<UtiltiyTerm %s, instance of %s>' %(
return '<UtilityTerm %s, instance of %s>' %(
def __repr__(self): return '<UtiltiyTerm %s, instance of %s>' %( self.token, self.value.__class__.__name__)
9d3ea1c3199a9cfb3a12acbf8d1bed27165a7f87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/9d3ea1c3199a9cfb3a12acbf8d1bed27165a7f87/vocabulary.py
[(u'object1', <UtiltiyTerm object1, instance of Object>), (u'object2', <UtiltiyTerm object2, instance of Object>), (u'object3', <UtiltiyTerm object3, instance of Object>)]
[(u'object1', <UtilityTerm object1, instance of Object>), (u'object2', <UtilityTerm object2, instance of Object>), (u'object3', <UtilityTerm object3, instance of Object>)]
... def __repr__(self):
9d3ea1c3199a9cfb3a12acbf8d1bed27165a7f87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/9d3ea1c3199a9cfb3a12acbf8d1bed27165a7f87/vocabulary.py
<UtiltiyTerm object1, instance of Object>
<UtilityTerm object1, instance of Object>
... def __repr__(self):
9d3ea1c3199a9cfb3a12acbf8d1bed27165a7f87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/9d3ea1c3199a9cfb3a12acbf8d1bed27165a7f87/vocabulary.py
<UtiltiyTerm object1, instance of Object>
<UtilityTerm object1, instance of Object>
... def __repr__(self):
9d3ea1c3199a9cfb3a12acbf8d1bed27165a7f87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/9d3ea1c3199a9cfb3a12acbf8d1bed27165a7f87/vocabulary.py
[(u'object1', <UtiltiyTerm object1, instance of Object>), (u'object2', <UtiltiyTerm object2, instance of Object>), (u'object3', <UtiltiyTerm object3, instance of Object>)]
[(u'object1', <UtilityTerm object1, instance of Object>), (u'object2', <UtilityTerm object2, instance of Object>), (u'object3', <UtilityTerm object3, instance of Object>)]
... def __repr__(self):
9d3ea1c3199a9cfb3a12acbf8d1bed27165a7f87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/9d3ea1c3199a9cfb3a12acbf8d1bed27165a7f87/vocabulary.py
_url = '/' + '/'.join( [request.environ['pylons.routes_dict']['controller']])
_url = h.url_for( controller=request.environ['pylons.routes_dict']['controller'], action=None, id=None )
def get_nav_class_state(url, request, partial=False): """ Helper function that just returns the 'active'/'inactive' link class based on the passed url. """ if partial: _url = '/' + '/'.join( [request.environ['pylons.routes_dict']['controller']]) else: _url = '/' + '/'.join([ request.environ['pylons.routes_dict']['controller'], request.environ['pylons.routes_dict']['action']]) if url == request.path_info: return 'active' elif url.startswith(_url) and partial: return 'active' elif url == _url: return 'active' else: return 'inactive'
c7a0f886cee8f7572dfcb1f3d10f982a1b678871 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5821/c7a0f886cee8f7572dfcb1f3d10f982a1b678871/helpers.py
_url = '/' + '/'.join([ request.environ['pylons.routes_dict']['controller'], request.environ['pylons.routes_dict']['action']])
_url = h.url_for( controller=request.environ['pylons.routes_dict']['controller'], action=request.environ['pylons.routes_dict']['action'], id=None )
def get_nav_class_state(url, request, partial=False): """ Helper function that just returns the 'active'/'inactive' link class based on the passed url. """ if partial: _url = '/' + '/'.join( [request.environ['pylons.routes_dict']['controller']]) else: _url = '/' + '/'.join([ request.environ['pylons.routes_dict']['controller'], request.environ['pylons.routes_dict']['action']]) if url == request.path_info: return 'active' elif url.startswith(_url) and partial: return 'active' elif url == _url: return 'active' else: return 'inactive'
c7a0f886cee8f7572dfcb1f3d10f982a1b678871 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5821/c7a0f886cee8f7572dfcb1f3d10f982a1b678871/helpers.py
cgi.param(key, join(str(val)))
cgi.param(key, '\n'.join(val))
def get_perl_cgi(params_dict): params_dict = variable_decode(params_dict) cgi = g.perl.eval('$cgi = new CGI;') cgi.charset("UTF-8") for key, val in params_dict.iteritems(): if key in updatable_attributes: if isinstance(val, list): cgi.param(key, join(str(val))) else: cgi.param(key, str(val)) return cgi
b81819c871286c4344ab359db466b2655eb96359 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5821/b81819c871286c4344ab359db466b2655eb96359/ispman_helpers.py
APP_CONF = request.environ['paste.config']['app_conf']
def new_post(self, id): """The real work for the above action, where modifications are made permanent.""" if request.method != 'POST': redirect_to(action='new', id=None) # DO SOMETHING APP_CONF = request.environ['paste.config']['app_conf']
5960f954b2dc85f732f1832b34a89faa3c270070 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5821/5960f954b2dc85f732f1832b34a89faa3c270070/accounts.py
userinfo['radiusProfileDN'] = u'cn=default, ou=radiusprofiles, ' + \ APP_CONF['ispman_ldap_base_dn']
userinfo['radiusProfileDN'] = u'cn=default, ou=radiusprofiles, ' + g.ldap_base_dn
def new_post(self, id): """The real work for the above action, where modifications are made permanent.""" if request.method != 'POST': redirect_to(action='new', id=None) # DO SOMETHING APP_CONF = request.environ['paste.config']['app_conf']
5960f954b2dc85f732f1832b34a89faa3c270070 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5821/5960f954b2dc85f732f1832b34a89faa3c270070/accounts.py
PERL_THREAD_TEST_1 = True PERL_THREAD_TEST_2 = True
PERL_USETHREADS = True
def run_tests(self): PERL_THREAD_TEST_1 = True PERL_THREAD_TEST_2 = True
7895cc4067c69d8f3df276522deda2db07484bb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5821/7895cc4067c69d8f3df276522deda2db07484bb3/setup.py
PERL_THREAD_TEST_1 = False
PERL_USETHREADS = False
def run_tests(self): PERL_THREAD_TEST_1 = True PERL_THREAD_TEST_2 = True
7895cc4067c69d8f3df276522deda2db07484bb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5821/7895cc4067c69d8f3df276522deda2db07484bb3/setup.py
process = subprocess.Popen( ["perl", "-V:use5005threads"], stderr=subprocess.PIPE, stdout=subprocess.PIPE ) output = process.stdout.readlines() for line in output: if line.find("'undef';") != -1: PERL_THREAD_TEST_2 = False return PERL_THREAD_TEST_1 and PERL_THREAD_TEST_2
return PERL_USETHREADS
def run_tests(self): PERL_THREAD_TEST_1 = True PERL_THREAD_TEST_2 = True
7895cc4067c69d8f3df276522deda2db07484bb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5821/7895cc4067c69d8f3df276522deda2db07484bb3/setup.py
print "Perl not compiled with threads support"
print "Perl not compiled with 'usethreads' support."
def run(self): cur_dir = os.getcwd() if not self.run_tests(): print "Perl not compiled with threads support" print "Removing 'MULTI_PERL'" os.unlink(os.path.join(cur_dir, 'MULTI_PERL'))
7895cc4067c69d8f3df276522deda2db07484bb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5821/7895cc4067c69d8f3df276522deda2db07484bb3/setup.py
StorageTestBase.removefs("Dest.fs")
removefs("Dest.fs")
def checkRecoverUndoInVersion(self): oid = self._storage.new_oid() version = "aVersion" revid_a = self._dostore(oid, data=MinPO(91)) revid_b = self._dostore(oid, revid=revid_a, version=version, data=MinPO(92)) revid_c = self._dostore(oid, revid=revid_b, version=version, data=MinPO(93)) self._undo(self._storage.undoInfo()[0]['id'], oid) self._commitVersion(version, '') self._undo(self._storage.undoInfo()[0]['id'], oid)
c0915ed1a55d30156cd233edae9860a28c0d5f76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c0915ed1a55d30156cd233edae9860a28c0d5f76/RecoveryStorage.py
o=objects.pop()
o=objects[-1]
def commit(self, subtransaction=None): 'Finalize the transaction'
5c5ca791d9cee59f2f835fffc4bfe35307fd8321 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5c5ca791d9cee59f2f835fffc4bfe35307fd8321/Transaction.py