rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
output = stream.render('xhtml', doctype=DocType.XHTML_STRICT, encoding='utf-8')
output = stream.render('xhtml', doctype=DocType.XHTML_STRICT, encoding='utf-8')
def send_project_index(environ, start_response, parent_dir=None, env_paths=None): req = Request(environ, start_response) loadpaths = [pkg_resources.resource_filename('trac', 'templates')] use_clearsilver = False if req.environ.get('trac.env_index_template'): tmpl_path, template = os.path.split(req.environ['trac.env_in...
bc50767f0b9dae6050d96f2a750f232b8fe98680 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/bc50767f0b9dae6050d96f2a750f232b8fe98680/main.py
req.outcookie['trac_auth']['path'] = req.base_path or '/'
req.outcookie['trac_auth']['path'] = self.auth_cookie_path \ or req.base_path or '/'
def store_session_cookie(db): cursor = db.cursor() cursor.execute("INSERT INTO auth_cookie (cookie,name,ipnr,time) " "VALUES (%s, %s, %s, %s)", (cookie, remote_user, req.remote_addr, int(time.time())))
ec4c48e29f24a83f30f6b75e59b713b97ee22f99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ec4c48e29f24a83f30f6b75e59b713b97ee22f99/auth.py
req.outcookie['trac_auth']['path'] = req.base_path or '/'
req.outcookie['trac_auth']['path'] = self.auth_cookie_path \ or req.base_path or '/'
def _expire_cookie(self, req): """Instruct the user agent to drop the auth cookie by setting the "expires" property to a date in the past. """ req.outcookie['trac_auth'] = '' req.outcookie['trac_auth']['path'] = req.base_path or '/' req.outcookie['trac_auth']['expires'] = -10000 if self.env.secure_cookies: req.outcooki...
ec4c48e29f24a83f30f6b75e59b713b97ee22f99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ec4c48e29f24a83f30f6b75e59b713b97ee22f99/auth.py
link_elt = extract_link(self.env, Context.from_request(req), link) if isinstance(link_elt, Element): href = link_elt.attrib.get('href')
link_frag = extract_link(self.env, Context.from_request(req), link) def get_first_href(item): """Depth-first search for the first `href` attribute.""" if isinstance(item, Element): href = item.attrib.get('href') if href is not None: return href if isinstance(item, Fragment): for each in item.children: href = get_first...
def process_request(self, req): link = req.args.get('link', '') parts = link.split(':', 1) if len(parts) > 1: resolver, target = parts if target and (target[0] not in '\'"' or target[0] != target[-1]): link = '%s:"%s"' % (resolver, target) link_elt = extract_link(self.env, Context.from_request(req), link) if isinstance...
4b17ce978386ea1112f45cf2a164dbceb93ab635 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/4b17ce978386ea1112f45cf2a164dbceb93ab635/intertrac.py
if not changes: raise TracError(_('Invalid unified diff content'))
if not changes or not any(c['diffs'] for c in changes): self.log.warning('Invalid unified diff content') return
def render(self, context, mimetype, content, filename=None, rev=None): req = context.req content = content_to_unicode(self.env, content, mimetype) changes = self._diff_to_hdf(content.splitlines(), Mimeview(self.env).tab_width) if not changes: raise TracError(_('Invalid unified diff content')) data = {'diff': {'style': ...
61ecb92a9f85b26e2f7012198ac6403e2ee13267 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/61ecb92a9f85b26e2f7012198ac6403e2ee13267/patch.py
"""Simple SQLite-specific backup of the database.
"""Create a backup of the database.
def backup(self, dest=None): """Simple SQLite-specific backup of the database.
a15613abb3aecb34fb9ea8b8044e780d698c8b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/a15613abb3aecb34fb9ea8b8044e780d698c8b52/env.py
'today': format_date(today), 'yesterday': format_date(today - timedelta(days=1)),
'today': format_date(today, tzinfo=req.tz), 'yesterday': format_date(today - timedelta(days=1), tzinfo=req.tz),
def process_request(self, req): req.perm.assert_permission('TIMELINE_VIEW')
61f38bc59022492bee586420f675efd57df5a740 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/61f38bc59022492bee586420f675efd57df5a740/web_ui.py
control.append(tag([_('to '), tag.input(type='text', id=id, name=id, value=owner)]))
control.append(tag_('to %(owner)s', owners=tag.input(type='text', id=id, name=id, value=owner)))
def render_ticket_action_control(self, req, ticket, action):
a29f65e4d387ef80c9e373bbd2b3be771700edf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/a29f65e4d387ef80c9e373bbd2b3be771700edf9/default_workflow.py
control.append(tag([_("to "), tag.select(
control.append(tag_('to %(owner)s', owner=tag.select(
def render_ticket_action_control(self, req, ticket, action):
a29f65e4d387ef80c9e373bbd2b3be771700edf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/a29f65e4d387ef80c9e373bbd2b3be771700edf9/default_workflow.py
id=id, name=id)]))
id=id, name=id)))
def render_ticket_action_control(self, req, ticket, action):
a29f65e4d387ef80c9e373bbd2b3be771700edf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/a29f65e4d387ef80c9e373bbd2b3be771700edf9/default_workflow.py
control.append(tag([_('as '), tag.select(
control.append(tag_('as %(resolution)s', resolution=tag.select(
def render_ticket_action_control(self, req, ticket, action):
a29f65e4d387ef80c9e373bbd2b3be771700edf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/a29f65e4d387ef80c9e373bbd2b3be771700edf9/default_workflow.py
id=id, name=id)]))
id=id, name=id)))
def render_ticket_action_control(self, req, ticket, action):
a29f65e4d387ef80c9e373bbd2b3be771700edf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/a29f65e4d387ef80c9e373bbd2b3be771700edf9/default_workflow.py
def _octal(option, opt_str, value, parser): try: setattr(parser.values, option.dest, int(value, 8)) except ValueError: raise OptionValueError('Invalid octal umask value: %r' % value)
1f7df8f8c95b1ed0f50fe0a1ee431dc0e6788913 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/1f7df8f8c95b1ed0f50fe0a1ee431dc0e6788913/standalone.py
help='When daemonizing, file to which to write pid')
help='when daemonizing, file to which to write pid')
def _octal(option, opt_str, value, parser): try: setattr(parser.values, option.dest, int(value, 8)) except ValueError: raise OptionValueError('Invalid octal umask value: %r' % value)
1f7df8f8c95b1ed0f50fe0a1ee431dc0e6788913 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/1f7df8f8c95b1ed0f50fe0a1ee431dc0e6788913/standalone.py
help='When daemonizing, file mode creation mask '
help='when daemonizing, file mode creation mask '
def _octal(option, opt_str, value, parser): try: setattr(parser.values, option.dest, int(value, 8)) except ValueError: raise OptionValueError('Invalid octal umask value: %r' % value)
1f7df8f8c95b1ed0f50fe0a1ee431dc0e6788913 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/1f7df8f8c95b1ed0f50fe0a1ee431dc0e6788913/standalone.py
protocol='http', http11=True, umask=022)
protocol='http', http11=True, umask=022, user=None, group=None)
def _octal(option, opt_str, value, parser): try: setattr(parser.values, option.dest, int(value, 8)) except ValueError: raise OptionValueError('Invalid octal umask value: %r' % value)
1f7df8f8c95b1ed0f50fe0a1ee431dc0e6788913 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/1f7df8f8c95b1ed0f50fe0a1ee431dc0e6788913/standalone.py
except OSError:
except OSError, e: print >> sys.stderr, '%s: %s' % (e.__class__.__name__, e)
def modification_callback(file): print >> sys.stderr, 'Detected modification of %s, ' \ 'restarting.' % file
1f7df8f8c95b1ed0f50fe0a1ee431dc0e6788913 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/1f7df8f8c95b1ed0f50fe0a1ee431dc0e6788913/standalone.py
return self.youngest_rev
return self.youngest_rev or 0
def normalize_rev(self, rev): if rev is None or isinstance(rev, basestring) and \ rev.lower() in ('', 'head', 'latest', 'youngest'): return self.youngest_rev else: try: rev = int(rev) if rev <= self.youngest_rev: return rev except (ValueError, TypeError): pass raise NoSuchChangeset(rev)
3138664b961ea1e7143d3d7b8fca9e19e5a469e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/3138664b961ea1e7143d3d7b8fca9e19e5a469e8/cache.py
old_version=old_version))
old_version=old_version, version=version))
def process_request(self, req): action = req.args.get('action', 'view') pagename = req.args.get('page', 'WikiStart') version = req.args.get('version') old_version = req.args.get('old_version')
83526e8fae1701a8052596c077a1e61a94ade974 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/83526e8fae1701a8052596c077a1e61a94ade974/web_ui.py
self.env = EnvironmentStub(default_data=True) from trac.core import ComponentMeta self.old_registry = ComponentMeta._registry ComponentMeta._registry = {}
self.env = EnvironmentStub(default_data=False, enable=['%s.%s' % (self.__module__, c) for c in ['Converter0', 'Converter1', 'Converter2']])
def setUp(self): self.env = EnvironmentStub(default_data=True)
4222037b915e682a9371084038601ae8cd05b4bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/4222037b915e682a9371084038601ae8cd05b4bd/api.py
from trac.core import ComponentMeta ComponentMeta._registry = self.old_registry
pass
def tearDown(self): # Restore the original component registry from trac.core import ComponentMeta ComponentMeta._registry = self.old_registry
4222037b915e682a9371084038601ae8cd05b4bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/4222037b915e682a9371084038601ae8cd05b4bd/api.py
class_=prev_link or 'missing'))
class_=not prev_link and 'missing' or None))
def prevnext_nav(req, prev_label, next_label, up_label=None): """Add Previous/Up/Next navigation links. @param req a `Request` object @param prev_label the label to use for left (previous) link @param up_label the label to use for the middle (up) link @param next_label the label to use for right (next) link "...
a4ca81a22271a72594005258eb4d76fa6e1269b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/a4ca81a22271a72594005258eb4d76fa6e1269b3/chrome.py
class_=next_link or 'missing'))
class_=not next_link and 'missing' or None))
def prevnext_nav(req, prev_label, next_label, up_label=None): """Add Previous/Up/Next navigation links. @param req a `Request` object @param prev_label the label to use for left (previous) link @param up_label the label to use for the middle (up) link @param next_label the label to use for right (next) link "...
a4ca81a22271a72594005258eb4d76fa6e1269b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/a4ca81a22271a72594005258eb4d76fa6e1269b3/chrome.py
ticket, self.db, when=modtime):
ticket, self.db, when=modtime):
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
da2496a3ac027731fc150ee0fa0ccf80086a21e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/da2496a3ac027731fc150ee0fa0ccf80086a21e0/notification.py
old_descr = old_descr.replace(2*CRLF, CRLF + '>' + \
old_descr = old_descr.replace(2 * CRLF, CRLF + '>' + \
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
da2496a3ac027731fc150ee0fa0ccf80086a21e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/da2496a3ac027731fc150ee0fa0ccf80086a21e0/notification.py
cdescr += 'Old description:' + 2*CRLF + old_descr + \ 2*CRLF cdescr += 'New description:' + 2*CRLF + new_descr + \
cdescr += 'Old description:' + 2 * CRLF + old_descr + \ 2 * CRLF cdescr += 'New description:' + 2 * CRLF + new_descr + \
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
da2496a3ac027731fc150ee0fa0ccf80086a21e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/da2496a3ac027731fc150ee0fa0ccf80086a21e0/notification.py
l = 7 + len(field) chg = wrap('%s => %s' % (old, new), self.COLS - l, '', l * ' ', CRLF) changes_body += ' * %s: %s%s' % (field, chg, CRLF)
length = 7 + len(field) spacer_old, spacer_new = ' ', ' ' if len(old + new) + length > self.COLS: length = 5 if len(old) + length > self.COLS: spacer_old = CRLF if len(new) + length > self.COLS: spacer_new = CRLF chg = '* %s: %s%s%s=>%s%s' % (field, spacer_old, old, spacer_old, spacer_new, new) chg = chg.replace(CRLF, ...
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
da2496a3ac027731fc150ee0fa0ccf80086a21e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/da2496a3ac027731fc150ee0fa0ccf80086a21e0/notification.py
write_prop('URL', req.base_url + '/milestone/' + milestone.name)
write_prop('URL', req.abs_href.milestone(milestone.name))
def write_utctime(name, value, params={}): write_prop(name, format_datetime(value, '%Y%m%dT%H%M%SZ', utc), params)
1b0ab351aab5c20b081a1e133859833be9e3d508 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/1b0ab351aab5c20b081a1e133859833be9e3d508/roadmap.py
stream.render(method, doctype=doctype, out=buffer)
stream.render(method, doctype=doctype, out=buffer, encoding="utf-8")
def render_template(self, req, filename, data, content_type=None, fragment=False): """Render the `filename` using the `data` for the context.
ee4b1fe9f881d2dd57084aa51f26be984c899eeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ee4b1fe9f881d2dd57084aa51f26be984c899eeb/chrome.py
parser.add_option('--value', dest='template_values', action = 'append',
parser.add_option('--value', dest='template_values', action = 'append',default = [],
def main(args): parser = OptionParser("usage: %prog [-o file] [-i file] [--value name1=value --value name2=value ...] template") parser.add_option('--search-path-template', dest='template_search_path', default='.', action = 'store', help = 'Comma seperated list of directories to search for templates (defaults to ".")')...
d3e6c0fcf0c862fe2938178a4cdbc1265864144b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10781/d3e6c0fcf0c862fe2938178a4cdbc1265864144b/dtrender.py
creator=request.user, name=name, description=description, is_active=True)
creator=request.user, name=name, category=category, description=description, is_active=True)
def create_project(request): if request.method != 'POST': new_project_form = ProjectForm() project_datasets = ProjectDataSetFormSet(prefix='project_datasets') else: project_datasets = ProjectDataSetFormSet(request.POST, prefix='project_datasets') new_project_form = ProjectForm(request.POST) if new_project_form.is_vali...
35d156bd3ce768abd6a855eefc93e0fd7d528691 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2706/35d156bd3ce768abd6a855eefc93e0fd7d528691/views.py
if self.generator_module_name == 'initial_data': if os.path.exists('initial_data.json'): os.rename('initial_data.json', 'initial_data.json.bak') print "renaming initial_data.json" else: from django.core import management management.call_command('reset', 'auth', 'sites', 'contenttypes', interactive=False)
def execute(self): # We need a temporary database to store the data created within the # fixture generators. If we don't setup the temporary database, our # actual production database will most likely be dirtied. if self.generator_module_name == 'initial_data': if os.path.exists('initial_data.json'): os.rename('initia...
cff9d5599cf1dc9ce3761cd44ee04d58905f81e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2706/cff9d5599cf1dc9ce3761cd44ee04d58905f81e7/FixtureGenerator.py
management.call_command(DJANGO_DUMP_DATA_INTO_FIXTURE_COMMAND)
management.call_command(DJANGO_DUMP_DATA_INTO_FIXTURE_COMMAND, exclude=["contenttypes"])
def _try_to_generate_fixture(self): # The generator file name is relative to its path. Since we're # not executing from that path, we need the full file path to it. generator_file_name = self._get_full_generator_file_name() fixture_name = self._construct_fixture_file_name() print 'Using fixture generator "%s" to gen...
cff9d5599cf1dc9ce3761cd44ee04d58905f81e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2706/cff9d5599cf1dc9ce3761cd44ee04d58905f81e7/FixtureGenerator.py
nodesbytotalawardmoney.sort(bytotalawardmoney) nodesbytotalawardmoney.reverse() for i in range(0, 50): nodesbytotalawardmoney[i].labelvisible=true for i in range(0, 10): print str(nodesbytotalawardmoney[i].label) + ": " + str(nodesbytotalawardmoney[i].totalawardmoney)
nodesByTotalAwardMoney.sort(bytotalawardmoney) nodesByTotalAwardMoney.reverse() for i in range(0, min(nodesByTotalAwardMoney.size(), 50)): nodesByTotalAwardMoney[i].labelvisible=true for i in range(0, min(nodesByTotalAwardMoney, 10)): print str(nodesByTotalAwardMoney[i].label) + ": " + str(nodesByTotalAwardMoney[i]....
def bytotalawardmoney(n1,n2): return cmp(n1.totalawardmoney, n2.totalawardmoney)
2073580590c5766cf198b81360e9df5c8bac4d74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2706/2073580590c5766cf198b81360e9df5c8bac4d74/co-PI-nw.py
addNodeField(ORIGINAL_LABEL_FIELD_NAME, Types.VARCHAR, "") setattr(g.nodes, ORIGINAL_LABEL_FIELD_NAME, g.nodes.label) addEdgeField(ORIGINAL_LABEL_FIELD_NAME, Types.VARCHAR, "") setattr(g.edges, ORIGINAL_LABEL_FIELD_NAME, g.edges.label)
def initializeGlobalVariables(): # put all the color names into an array for i in colorInfo: colorList.append(i[0]) gStuff = globals() # all variables that have been declared # the properties of nodes and edges specified in the gdf file originalGraphProperties = [] wantedDefaultProperties = [] # get all methods and va...
f9a3e158289d1f03c636bc1b8e9bd9a6cbb0bebf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2706/f9a3e158289d1f03c636bc1b8e9bd9a6cbb0bebf/graphModifier.py
return HttpResponseredirect(reverse(DEACTIVATED_ACCOUNT_VIEW))
return HttpResponseRedirect(reverse(DEACTIVATED_ACCOUNT_VIEW))
def forgot_password(request): if request.method != 'POST': form = ForgotPasswordForm() else: form = ForgotPasswordForm(request.POST) if form.is_valid(): user = form.cleaned_data['user'] if not user.is_active: return HttpResponseredirect(reverse(DEACTIVATED_ACCOUNT_VIEW)) new_password = UserManager().make_random_pass...
d9e47cf206613d3e27c29947a36019a3cfd6c703 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2706/d9e47cf206613d3e27c29947a36019a3cfd6c703/views.py
email_body = loader.get_template('core/registration_email.html')
email_body = loader.get_template('core/registration_email.txt')
def form_email_about_registration(request, user, profile): email_body = loader.get_template('core/registration_email.html') activation_url = request.build_absolute_uri( reverse('epic.core.views.activate', kwargs={'activation_key': profile.activation_key})) login_url = request.build_absolute_uri(reverse('django.contrib....
81f700ff6e4aab5fe69fb92179d473683965917a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2706/81f700ff6e4aab5fe69fb92179d473683965917a/views.py
email_body = loader.get_template('core/password_reset_email.html')
email_body = loader.get_template('core/password_reset_email.txt')
def _form_email_about_password_changed(request, user, new_password): email_body = loader.get_template('core/password_reset_email.html') login_url = request.build_absolute_uri(reverse('django.contrib.auth.views.login')) # TODO: Probably not the best security to be sending a plaintext password. template_context_data = {...
81f700ff6e4aab5fe69fb92179d473683965917a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2706/81f700ff6e4aab5fe69fb92179d473683965917a/views.py
'f': '%f', 'd': '%f',
'f': '%.15f', 'd': '%.15f',
def fmt2printfmt(fmt): """Returns printf-like formatter for given binary data type sepecifier.""" fmttypes = { 'B': '%d', # PT_8BUI 'h': '%d', # PT_16BSI 'H': '%d', # PT_16BUI 'i': '%d', # PT_32BSI 'I': '%d', # PT_32BUI 'f': '%f', # PT_32BF 'd': '%f', # PT_64BF 's': '%s' } return fmttypes.get(fmt, 'f')
0e3b39fcfbd547a6a79bbfd3dd1bb9d81601c12d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11120/0e3b39fcfbd547a6a79bbfd3dd1bb9d81601c12d/raster2pgsql.py
extgeom = "ST_Envelope(ST_SetSRID('POLYGON((%f %f,%f %f,%f %f,%f %f,%f %f))'::geometry, %d))" % \
extgeom = "ST_Envelope(ST_SetSRID('POLYGON((%.15f %.15f,%.15f %.15f,%.15f %.15f,%.15f %.15f,%.15f %.15f))'::geometry, %d))" % \
def make_sql_addrastercolumn(options, pixeltypes, nodata, pixelsize, blocksize, extent): assert len(pixeltypes) > 0, "No pixel types given" ts = make_sql_schema_table_names(options.table) pt = make_sql_value_array(pixeltypes) nd = 'null' if nodata is not None and len(nodata) > 0: nd = make_sql_value_array(nodata) odb...
0e3b39fcfbd547a6a79bbfd3dd1bb9d81601c12d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11120/0e3b39fcfbd547a6a79bbfd3dd1bb9d81601c12d/raster2pgsql.py
sql = "SELECT AddRasterColumn('%s','%s','%s',%d, %s, %s, %s, %s, %f, %f, %s, %s, %s);\n" % \
sql = "SELECT AddRasterColumn('%s','%s','%s',%d, %s, %s, %s, %s, %.15f, %.15f, %s, %s, %s);\n" % \
def make_sql_addrastercolumn(options, pixeltypes, nodata, pixelsize, blocksize, extent): assert len(pixeltypes) > 0, "No pixel types given" ts = make_sql_schema_table_names(options.table) pt = make_sql_value_array(pixeltypes) nd = 'null' if nodata is not None and len(nodata) > 0: nd = make_sql_value_array(nodata) odb...
0e3b39fcfbd547a6a79bbfd3dd1bb9d81601c12d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11120/0e3b39fcfbd547a6a79bbfd3dd1bb9d81601c12d/raster2pgsql.py
sql = make_sql_insert_raster(gen_table, options.column, hexwkb, options.filename, file)
sql = make_sql_insert_raster(gen_table, options.column, hexwkb, options.filename, infile)
def wkblify_raster_level(options, ds, level, band_range, infile, i): assert ds is not None assert level >= 1 assert len(band_range) == 2 band_from = band_range[0] band_to = band_range[1] # Collect raster and block dimensions raster_size = ( ds.RasterXSize, ds.RasterYSize ) if options.block_size is not None: block_siz...
247098bcdc4cb0e9508e18fe8578c9978d043249 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11120/247098bcdc4cb0e9508e18fe8578c9978d043249/gdal2raster.py
wkblify_raster(opts, filename, i)
wkblify_raster(opts, filename.replace( '\\', '/') , i)
def main(): (opts, args) = parse_command_line() global VERBOSE VERBOSE = opts.verbose global SUMMARY SUMMARY = [] saved_out = sys.stdout if type(opts.output) is str: filename = opts.output opts.output = open(filename, "w") # BEGIN opts.output.write('BEGIN;\n') # If overviews requested, CREATE TABLE raster_overvie...
247098bcdc4cb0e9508e18fe8578c9978d043249 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11120/247098bcdc4cb0e9508e18fe8578c9978d043249/gdal2raster.py
def test2(): point_list = [[i] for i in range(1,32)]
def testKdSearchNN(): n = 2**8 point_list = [[i,n-i] for i in range(1,n)]
def test2(): point_list = [[i] for i in range(1,32)] node = kdTree(point_list) node.show() print 'point_list', point_list for point in point_list: best = kdSearchNN(node, point, node, 0) print 'point =', point, ', best =', best.location
61c03666b260c361116e556d45b8fe221cf9b116 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14140/61c03666b260c361116e556d45b8fe221cf9b116/kd_tree.py
def test2(): point_list = [[i] for i in range(1,32)] node = kdTree(point_list) node.show() print 'point_list', point_list for point in point_list: best = kdSearchNN(node, point, node, 0) print 'point =', point, ', best =', best.location
61c03666b260c361116e556d45b8fe221cf9b116 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14140/61c03666b260c361116e556d45b8fe221cf9b116/kd_tree.py
best = kdSearchNN(node, point, node, 0) print 'point =', point, ', best =', best.location
point2 = [x + .4 for x in point] point2 = point best = kdSearchNN(node, point2, node, 0) print 'point =', point, 'point2 =', point2, ', best =', best.location, '***' if point != best.location else ''
def test2(): point_list = [[i] for i in range(1,32)] node = kdTree(point_list) node.show() print 'point_list', point_list for point in point_list: best = kdSearchNN(node, point, node, 0) print 'point =', point, ', best =', best.location
61c03666b260c361116e556d45b8fe221cf9b116 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14140/61c03666b260c361116e556d45b8fe221cf9b116/kd_tree.py
test2()
testKdSearchNN()
def test2(): point_list = [[i] for i in range(1,32)] node = kdTree(point_list) node.show() print 'point_list', point_list for point in point_list: best = kdSearchNN(node, point, node, 0) print 'point =', point, ', best =', best.location
61c03666b260c361116e556d45b8fe221cf9b116 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14140/61c03666b260c361116e556d45b8fe221cf9b116/kd_tree.py
showTitle = sys.argv[1].lower().replace(' ', '_') showTitle = sys.argv[1].replace('-', '_')
showTitle = sys.argv[1] showTitle = showTitle.lower() showTitle = showTitle.replace(' ', '_') showTitle = showTitle.replace('-', '_')
def fixupTitle(): showTitle = sys.argv[1].lower().replace(' ', '_') showTitle = sys.argv[1].replace('-', '_') showTitle = showTitle.replace(':', '') showTitle = re.sub('^the_', '', showTitle) showTitle = re.sub('two_and_a_half_men', 'two_half_men', showTitle) return showTitle
af1037e93b64f1d3873829138ca6e357b8991c0d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13556/af1037e93b64f1d3873829138ca6e357b8991c0d/MythTVGetGlueCheckin4.py
def GlueByContents(fout, url, regmemdate): ur = urllib.urlopen(url)
def GlueByContents(fout, url_contents, regmemdate): ur = urllib.urlopen(url_contents)
def GlueByContents(fout, url, regmemdate): ur = urllib.urlopen(url) sr = ur.read() ur.close() soup = BeautifulSoup.BeautifulSoup(sr) mps = soup.find('a', attrs={'name':'A'}).parent.findNextSiblings('p') for p in mps: ur = urlparse.urljoin(url, p.a['href']) print " reading " + ur ur = urllib.urlopen(ur) sr = ur.read() ...
7e5b95340cd6a854e2db83b003494de7352e88cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8428/7e5b95340cd6a854e2db83b003494de7352e88cc/regmempullgluepages.py
ur = urlparse.urljoin(url, p.a['href']) print " reading " + ur ur = urllib.urlopen(ur)
url = urlparse.urljoin(url_contents, p.a['href']) print " reading " + url ur = urllib.urlopen(url)
def GlueByContents(fout, url, regmemdate): ur = urllib.urlopen(url) sr = ur.read() ur.close() soup = BeautifulSoup.BeautifulSoup(sr) mps = soup.find('a', attrs={'name':'A'}).parent.findNextSiblings('p') for p in mps: ur = urlparse.urljoin(url, p.a['href']) print " reading " + ur ur = urllib.urlopen(ur) sr = ur.read() ...
7e5b95340cd6a854e2db83b003494de7352e88cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8428/7e5b95340cd6a854e2db83b003494de7352e88cc/regmempullgluepages.py
if re.match('200[6789]', date):
if int(date[0:4]) >= 2006:
def parse_day(self, fp, text, date): self.date = date
1ec6296a46167213bb6f45ed3597d45a932046b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8428/1ec6296a46167213bb6f45ed3597d45a932046b4/parse.py
for ixurl in ( 'http://www.publications.parliament.uk/pa/cm/cmregmem/memi02.htm', 'http://www.publications.parliament.uk/pa/cm200304/cmregmem/memi02.htm' ): ur = urllib.urlopen(ixurl) content = ur.read() ur.close(); allurls = re.findall('<a href="([^>]*)">(?i)', content) for url in allurls: if url.find("memi02...
ixurl = 'http://www.publications.parliament.uk/pa/cm/cmregmem/memi02.htm' ur = urllib.urlopen(ixurl) content = ur.read() ur.close(); allurls = re.findall('<a href="([^>]*)">(?i)', content) for url in allurls: if url.find("100203/") >= 0: continue if url.find("memi02") >= 0: url = urlparse.urljoin(ixurl, url) ur...
def FindRegmemPages(): urls = [] # Meta index is here: 'http://www.publications.parliament.uk/pa/cm/cmhocpap.htm' # We just grab some specific session index pages as it is too hard otherwise. # The first URL /pa/cm/cmregmem/memi02.htm should get all new regmems as they # arrive anyway. for ixurl in ( 'http://www.public...
3090b80192d51dd16b12afda6222144c3eeacce2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8428/3090b80192d51dd16b12afda6222144c3eeacce2/regmempullgluepages.py
def FindLordRegmemPages(): urls = [('2004-10-01', 'http://www.publications.parliament.uk/pa/ld200304/ldreg/reg01.htm')] ixurl = 'http://www.publications.parliament.uk/pa/ld/ldreg.htm' ur = urllib.urlopen(ixurl) content = ur.read() ur.close(); allurls = re.findall('<a href="([^>]*reg01[^>]*)">.*?position on (.*?)\)</a>...
3090b80192d51dd16b12afda6222144c3eeacce2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8428/3090b80192d51dd16b12afda6222144c3eeacce2/regmempullgluepages.py
if len(args) == 1: buildconfig = _GetConfig(args[0])
if len(args) >= 1: buildconfig = _GetConfig(args[-1])
def main(): # Parse options usage = "usage: %prog [options] cbuildbot_config" parser = optparse.OptionParser(usage=usage) parser.add_option('-r', '--buildroot', help='root directory where build occurs', default=".") parser.add_option('-n', '--buildnumber', help='build number', type='int', default=0) parser.add_option('...
aaba25d817f949f242f0fa617414a869cfe0a855 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/aaba25d817f949f242f0fa617414a869cfe0a855/cbuildbot.py
'client.*.DEBUG')
'%s*.DEBUG' % os.path.basename(test))
def _GenerateReportText(self): """Prints a result report to stdout.
62d75f058298313f2bd334824e5dbebc9597a540 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/62d75f058298313f2bd334824e5dbebc9597a540/generate_test_report.py
cwd=None, input=None, enter_chroot=False): """Runs a shell command.
cwd=None, input=None, enter_chroot=False, shell=False): """Runs a command.
def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None, exit_code=False, redirect_stdout=False, redirect_stderr=False, cwd=None, input=None, enter_chroot=False): """Runs a shell command. Keyword arguments: cmd - cmd to run. Should be input to subprocess.POpen. If a string, converted to an array using...
2e79fe48ce361b93d726cab4d55fbef17aa1d9c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/2e79fe48ce361b93d726cab4d55fbef17aa1d9c9/cros_build_lib.py
cmd - cmd to run. Should be input to subprocess.POpen. If a string, converted to an array using split().
cmd - cmd to run. Should be input to subprocess.Popen.
def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None, exit_code=False, redirect_stdout=False, redirect_stderr=False, cwd=None, input=None, enter_chroot=False): """Runs a shell command. Keyword arguments: cmd - cmd to run. Should be input to subprocess.POpen. If a string, converted to an array using...
2e79fe48ce361b93d726cab4d55fbef17aa1d9c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/2e79fe48ce361b93d726cab4d55fbef17aa1d9c9/cros_build_lib.py
if enter_chroot: cmd = ['./enter_chroot.sh', '--'] + cmd
if isinstance(cmd, basestring): if enter_chroot: cmd = './enter_chroot.sh -- ' + cmd cmd_str = cmd else: if enter_chroot: cmd = ['./enter_chroot.sh', '--'] + cmd cmd_str = ' '.join(cmd)
def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None, exit_code=False, redirect_stdout=False, redirect_stderr=False, cwd=None, input=None, enter_chroot=False): """Runs a shell command. Keyword arguments: cmd - cmd to run. Should be input to subprocess.POpen. If a string, converted to an array using...
2e79fe48ce361b93d726cab4d55fbef17aa1d9c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/2e79fe48ce361b93d726cab4d55fbef17aa1d9c9/cros_build_lib.py
Info('RunCommand: %s' % ' '.join(cmd))
Info('RunCommand: %s' % cmd_str)
def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None, exit_code=False, redirect_stdout=False, redirect_stderr=False, cwd=None, input=None, enter_chroot=False): """Runs a shell command. Keyword arguments: cmd - cmd to run. Should be input to subprocess.POpen. If a string, converted to an array using...
2e79fe48ce361b93d726cab4d55fbef17aa1d9c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/2e79fe48ce361b93d726cab4d55fbef17aa1d9c9/cros_build_lib.py
stdout=stdout, stderr=stderr)
stdout=stdout, stderr=stderr, shell=shell)
def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None, exit_code=False, redirect_stdout=False, redirect_stderr=False, cwd=None, input=None, enter_chroot=False): """Runs a shell command. Keyword arguments: cmd - cmd to run. Should be input to subprocess.POpen. If a string, converted to an array using...
2e79fe48ce361b93d726cab4d55fbef17aa1d9c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/2e79fe48ce361b93d726cab4d55fbef17aa1d9c9/cros_build_lib.py
raise Exception('Command "%s" failed.\n' % (' '.join(cmd)) +
raise Exception('Command "%s" failed.\n' % cmd_str +
def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None, exit_code=False, redirect_stdout=False, redirect_stderr=False, cwd=None, input=None, enter_chroot=False): """Runs a shell command. Keyword arguments: cmd - cmd to run. Should be input to subprocess.POpen. If a string, converted to an array using...
2e79fe48ce361b93d726cab4d55fbef17aa1d9c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/2e79fe48ce361b93d726cab4d55fbef17aa1d9c9/cros_build_lib.py
if buildconfig['master']: if cbuildbot_comm.HaveSlavesCompleted(config): _UprevPush(buildroot) _UprevCleanup(buildroot)
if options.debug: if buildconfig['master']: if cbuildbot_comm.HaveSlavesCompleted(config): _UprevPush(buildroot) else: _UprevCleanup(buildroot) Die('CBUILDBOT - One of the slaves has failed!!!')
def main(): # Parse options usage = "usage: %prog [options] cbuildbot_config" parser = optparse.OptionParser(usage=usage) parser.add_option('-r', '--buildroot', help='root directory where build occurs', default=".") parser.add_option('-n', '--buildnumber', help='build number', type='int', default=0) parser.add_option('...
debca5133266ea0a7af36d88f5fbe66970b5b6f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/debca5133266ea0a7af36d88f5fbe66970b5b6f4/cbuildbot.py
_UprevCleanup(buildroot) Die('CBUILDBOT - One of the slaves has failed!!!') else: if buildconfig['important']: cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_COMPLETE) _UprevCleanup(buildroot)
if buildconfig['important']: cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_COMPLETE) _UprevCleanup(buildroot)
def main(): # Parse options usage = "usage: %prog [options] cbuildbot_config" parser = optparse.OptionParser(usage=usage) parser.add_option('-r', '--buildroot', help='root directory where build occurs', default=".") parser.add_option('-n', '--buildnumber', help='build number', type='int', default=0) parser.add_option('...
debca5133266ea0a7af36d88f5fbe66970b5b6f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/debca5133266ea0a7af36d88f5fbe66970b5b6f4/cbuildbot.py
def FixPostInst(mount_point): postinst_in = os.path.join(mount_point, POST_INST_IN_FILENAME) f = open(postinst_in, 'r') postinst = f.read() f.close() m1 = postinst.find(EFI_CODE_MARKER_START) m2 = postinst.find(EFI_CODE_MARKER_END) if (m1 == -1) or (m2 == -1) or (m1 > m2): return m2 += len(EFI_CODE_MARKER_END) posti...
def FixXorgConf(mount_point): xorg_conf_filename = os.path.join(mount_point, XORG_CONF_FILENAME) f = open(xorg_conf_filename, 'r') xorg_conf = f.read() f.close() more_sections = 1 last_found = 0 while (more_sections): # Find the input section. m1 = xorg_conf.find(INPUT_SECTION_MARKER, last_found) if m1 > -1: m2 = xorg...
e79e88eb0ebd00998aa9feb256b8c6aaf21e4842 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/e79e88eb0ebd00998aa9feb256b8c6aaf21e4842/fixup_image_for_qemu.py
parser.add_option('--for_qemu', dest='for_qemu',
parser.add_option('--enable_tablet', dest='enable_tablet',
def main(): parser = OptionParser(USAGE) parser.add_option('--mounted_dir', dest='mounted_dir', help='directory where the Chromium OS image is mounted') parser.add_option('--for_qemu', dest='for_qemu', default="true", help='fixup image for qemu') (options, args) = parser.parse_args() if not options.mounted_dir: parser...
e79e88eb0ebd00998aa9feb256b8c6aaf21e4842 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/e79e88eb0ebd00998aa9feb256b8c6aaf21e4842/fixup_image_for_qemu.py
if options.for_qemu not in ('true', 'false'): parser.error("Please specify either true or false for --for_qemu")
if options.enable_tablet not in ('true', 'false'): parser.error("Please specify either true or false for --enable_tablet")
def main(): parser = OptionParser(USAGE) parser.add_option('--mounted_dir', dest='mounted_dir', help='directory where the Chromium OS image is mounted') parser.add_option('--for_qemu', dest='for_qemu', default="true", help='fixup image for qemu') (options, args) = parser.parse_args() if not options.mounted_dir: parser...
e79e88eb0ebd00998aa9feb256b8c6aaf21e4842 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/e79e88eb0ebd00998aa9feb256b8c6aaf21e4842/fixup_image_for_qemu.py
FixPostInst(options.mounted_dir) if (options.for_qemu == 'true'):
if (options.enable_tablet == 'true'):
def main(): parser = OptionParser(USAGE) parser.add_option('--mounted_dir', dest='mounted_dir', help='directory where the Chromium OS image is mounted') parser.add_option('--for_qemu', dest='for_qemu', default="true", help='fixup image for qemu') (options, args) = parser.parse_args() if not options.mounted_dir: parser...
e79e88eb0ebd00998aa9feb256b8c6aaf21e4842 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/e79e88eb0ebd00998aa9feb256b8c6aaf21e4842/fixup_image_for_qemu.py
if (revision_file):
if (revisionfile):
def _UprevPackages(buildroot, revisionfile): revisions = None if (revision_file): rev_file = revisionfile.open(revisionfile) revisions = rev_file.read() rev_file.close() # Note: Revisions == "None" indicates a Force Build. if revisions and revisions != 'None': print 'CBUILDBOT - Revision list found %s' % revisions pr...
2e9e668dc0bce79d1db3809371dd9c97c00d01fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/2e9e668dc0bce79d1db3809371dd9c97c00d01fc/cbuildbot.py
def RevGitFile(filename, key, value): """Update and push the git file.
def setUp(self): self.mox = mox.Mox()
def RevGitFile(filename, key, value): """Update and push the git file. Args: filename: file to modify that is in a git repo already key: board or host package type e.g. x86-dogfood value: string representing the version of the prebuilt that has been uploaded. """ prebuilt_branch = 'prebuilt_branch' old_cwd = os.getcwd...
4f33955508ba50045082608b1047ea86854e7297 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/4f33955508ba50045082608b1047ea86854e7297/prebuilt_unittest.py
Args: filename: file to modify that is in a git repo already key: board or host package type e.g. x86-dogfood value: string representing the version of the prebuilt that has been uploaded. """ prebuilt_branch = 'prebuilt_branch' old_cwd = os.getcwd() os.chdir(os.path.dirname(filename)) cros_build_lib.RunCommand('repo s...
def tearDown(self): self.mox.UnsetStubs() self.mox.VerifyAll()
def RevGitFile(filename, key, value): """Update and push the git file. Args: filename: file to modify that is in a git repo already key: board or host package type e.g. x86-dogfood value: string representing the version of the prebuilt that has been uploaded. """ prebuilt_branch = 'prebuilt_branch' old_cwd = os.getcwd...
4f33955508ba50045082608b1047ea86854e7297 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/4f33955508ba50045082608b1047ea86854e7297/prebuilt_unittest.py
def GetVersion(): """Get the version to put in LATEST and update the git version with.""" return datetime.datetime.now().strftime('%d.%m.%y.%H%M%S')
def _generate_dict_results(self, gs_bucket_path): """ Generate a dictionary result similar to GenerateUploadDict """ results = {} for entry in self.files_to_sync: results[entry] = os.path.join(gs_bucket_path, entry.replace(self.strip_path, '').lstrip('/')) return results
def GetVersion(): """Get the version to put in LATEST and update the git version with.""" return datetime.datetime.now().strftime('%d.%m.%y.%H%M%S')
4f33955508ba50045082608b1047ea86854e7297 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/4f33955508ba50045082608b1047ea86854e7297/prebuilt_unittest.py
def LoadFilterFile(filter_file): """Load a file with keywords on a perline basis.
def testGenerateUploadDict(self): gs_bucket_path = 'gs://chromeos-prebuilt/host/version' self.mox.StubOutWithMock(cros_build_lib, 'ListFiles') cros_build_lib.ListFiles(' ').AndReturn(self.files_to_sync) self.mox.ReplayAll() result = prebuilt.GenerateUploadDict(' ', gs_bucket_path, self.strip_path) print result self.ass...
def LoadFilterFile(filter_file): """Load a file with keywords on a perline basis. Args: filter_file: file to load into FILTER_PACKAGES """ filter_fh = open(filter_file) global FILTER_PACKAGES FILTER_PACKAGES = [filter.strip() for filter in filter_fh.readlines()] return FILTER_PACKAGES
4f33955508ba50045082608b1047ea86854e7297 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/4f33955508ba50045082608b1047ea86854e7297/prebuilt_unittest.py
Args: filter_file: file to load into FILTER_PACKAGES """ filter_fh = open(filter_file) global FILTER_PACKAGES FILTER_PACKAGES = [filter.strip() for filter in filter_fh.readlines()] return FILTER_PACKAGES def FilterPackage(file_path): """Skip a particular file if it matches a pattern. Skip any files that machine the ...
def LoadFilterFile(filter_file): """Load a file with keywords on a perline basis. Args: filter_file: file to load into FILTER_PACKAGES """ filter_fh = open(filter_file) global FILTER_PACKAGES FILTER_PACKAGES = [filter.strip() for filter in filter_fh.readlines()] return FILTER_PACKAGES
4f33955508ba50045082608b1047ea86854e7297 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/4f33955508ba50045082608b1047ea86854e7297/prebuilt_unittest.py
main()
unittest.main()
def main(): parser = optparse.OptionParser() parser.add_option('-b', '--board', dest='board', default=None, help='Board type that was built on this machine') parser.add_option('-p', '--build-path', dest='build_path', help='Path to the chroot') parser.add_option('-s', '--sync-host', dest='sync_host', default=False, acti...
4f33955508ba50045082608b1047ea86854e7297 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/4f33955508ba50045082608b1047ea86854e7297/prebuilt_unittest.py
percent_passed = self.VerifyImage(42)
percent_passed = self.VerifyImage(10)
def testFullUpdateKeepStateful(self): """Tests if we can update normally.
f38f249eb440154afdc1e6ac647fdbd20f170077 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/f38f249eb440154afdc1e6ac647fdbd20f170077/cros_au_test_harness.py
def NotestFullUpdateWipeStateful(self):
def testFullUpdateWipeStateful(self):
def NotestFullUpdateWipeStateful(self): """Tests if we can update after cleaning the stateful partition.
f38f249eb440154afdc1e6ac647fdbd20f170077 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/f38f249eb440154afdc1e6ac647fdbd20f170077/cros_au_test_harness.py
percent_passed = self.VerifyImage(42)
percent_passed = self.VerifyImage(10)
def NotestFullUpdateWipeStateful(self): """Tests if we can update after cleaning the stateful partition.
f38f249eb440154afdc1e6ac647fdbd20f170077 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/f38f249eb440154afdc1e6ac647fdbd20f170077/cros_au_test_harness.py
print ('\n========== DEBUG FILE %s FOR TEST %s ==============\n' % ( path, test)) print fh.read() print('\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( path, test))
print >> sys.stderr, ( '\n========== DEBUG FILE %s FOR TEST %s ==============\n' % ( path, test)) out = fh.read() while out: print >> sys.stderr, out out = fh.read() print >> sys.stderr, ( '\n=========== END DEBUG %s FOR TEST %s ===============\n' % ( path, test))
def _GenerateReportText(self): """Prints a result report to stdout.
5e0909abad016c53e4b73ee0b9691eefa477090c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/5e0909abad016c53e4b73ee0b9691eefa477090c/generate_test_report.py
output = RunCommand(['%s/cros_run_vm_test' % self.crosutilsbin, '--image_path=%s' % self.vm_image_path, '--snapshot', '--persist', vm_graphics_flag, '--kvm_pid=%s' % _KVM_PID_FILE, '--test_case=%s' % _VERIFY_SUITE, ], error_ok=True, enter_chroot=False, redirect_stdout=True)
commandWithArgs = ['%s/cros_run_vm_test' % self.crosutilsbin, '--image_path=%s' % self.vm_image_path, '--snapshot', '--persist', '--kvm_pid=%s' % _KVM_PID_FILE, _VERIFY_SUITE, ] if vm_graphics_flag: commandWithArgs.append(vm_graphics_flag) output = RunCommand(commandWithArgs, error_ok=True, enter_chroot=False, redir...
def VerifyImage(self, percent_required_to_pass): """Runs vm smoke suite to verify image.""" # image_to_live already verifies lsb-release matching. This is just # for additional steps. output = RunCommand(['%s/cros_run_vm_test' % self.crosutilsbin, '--image_path=%s' % self.vm_image_path, '--snapshot', '--persist', vm_g...
d0473d1e9f523b5029b1b9ed4a6e662f387a4bcf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/d0473d1e9f523b5029b1b9ed4a6e662f387a4bcf/cros_au_test_harness.py
def NotVerifyImage(self):
def VerifyImage(self):
def NotVerifyImage(self): """Verifies an image using run_remote_tests.sh with verification suite.""" RunCommand([ '%s/run_remote_tests.sh' % self.crosutils, '--remote=%s' % remote, _VERIFY_SUITE, ], error_ok=False, enter_chroot=False)
d8f50a931fbae28b2b91a3492b54336a618fbdc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/d8f50a931fbae28b2b91a3492b54336a618fbdc0/cros_au_test_harness.py
unittest.TextTestRunner(verbosity=2).run(suite)
return_code = unittest.TextTestRunner(verbosity=2).run(suite)
def VerifyImage(self): """Runs vm smoke suite to verify image.""" # image_to_live already verifies lsb-release matching. This is just # for additional steps. RunCommand(['%s/cros_run_vm_test' % self.crosutilsbin, '--image_path=%s' % self.vm_image_path, '--snapshot', '--persist', '--kvm_pid=%s' % _KVM_PID_FILE, '--test...
d8f50a931fbae28b2b91a3492b54336a618fbdc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/d8f50a931fbae28b2b91a3492b54336a618fbdc0/cros_au_test_harness.py
unittest.TextTestRunner(verbosity=2).run(suite)
return_code = unittest.TextTestRunner(verbosity=2).run(suite)
def VerifyImage(self): """Runs vm smoke suite to verify image.""" # image_to_live already verifies lsb-release matching. This is just # for additional steps. RunCommand(['%s/cros_run_vm_test' % self.crosutilsbin, '--image_path=%s' % self.vm_image_path, '--snapshot', '--persist', '--kvm_pid=%s' % _KVM_PID_FILE, '--test...
d8f50a931fbae28b2b91a3492b54336a618fbdc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/d8f50a931fbae28b2b91a3492b54336a618fbdc0/cros_au_test_harness.py
Die('Found multiple unstable ebuilds in %s' % root)
Die('Found multiple unstable ebuilds in %s' % os.path.dirname(path))
def _FindStableEBuilds(files): """Return a list of stable ebuilds from specified list of files. Args: files: List of files. """ workon_dir = False stable_ebuilds = [] unstable_ebuilds = [] for path in files: if path.endswith('.ebuild') and not os.path.islink(path): ebuild = _EBuild(path) if ebuild.is_workon: workon_di...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
Warning('Found multiple stable ebuilds in %s' % root)
Warning('Found multiple stable ebuilds in %s' % os.path.dirname(path))
def _FindStableEBuilds(files): """Return a list of stable ebuilds from specified list of files. Args: files: List of files. """ workon_dir = False stable_ebuilds = [] unstable_ebuilds = [] for path in files: if path.endswith('.ebuild') and not os.path.islink(path): ebuild = _EBuild(path) if ebuild.is_workon: workon_di...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
Die('Missing 9999 ebuild in %s' % root)
Die('Missing 9999 ebuild in %s' % os.path.dirname(path))
def _FindStableEBuilds(files): """Return a list of stable ebuilds from specified list of files. Args: files: List of files. """ workon_dir = False stable_ebuilds = [] unstable_ebuilds = [] for path in files: if path.endswith('.ebuild') and not os.path.islink(path): ebuild = _EBuild(path) if ebuild.is_workon: workon_di...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
Die('Missing stable ebuild in %s' % root)
Die('Missing stable ebuild in %s' % os.path.dirname(path))
def _FindStableEBuilds(files): """Return a list of stable ebuilds from specified list of files. Args: files: List of files. """ workon_dir = False stable_ebuilds = [] unstable_ebuilds = [] for path in files: if path.endswith('.ebuild') and not os.path.islink(path): ebuild = _EBuild(path) if ebuild.is_workon: workon_di...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
for root_dir, dirs, files in os.walk(overlay):
for package_dir, dirs, files in os.walk(overlay):
def _BuildEBuildDictionary(overlays, all, packages): """Build a dictionary of the ebuilds in the specified overlays. overlays: A map which maps overlay directories to arrays of stable EBuilds inside said directories. all: Whether to include all ebuilds in the specified directories. If true, then we gather all packages...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
paths = [os.path.join(root_dir, path) for path in files]
paths = [os.path.join(package_dir, path) for path in files]
def _BuildEBuildDictionary(overlays, all, packages): """Build a dictionary of the ebuilds in the specified overlays. overlays: A map which maps overlay directories to arrays of stable EBuilds inside said directories. all: Whether to include all ebuilds in the specified directories. If true, then we gather all packages...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
actual_project =_SimpleRunCommand(cmd).rstrip()
actual_project = _SimpleRunCommand(cmd).rstrip()
def GetCommitId(self): """Get the commit id for this ebuild."""
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
def RevEBuild(self, commit_id="", redirect_file=None):
def RevEBuild(self, commit_id='', redirect_file=None):
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
redirect_file.write(line.replace("~", ""))
redirect_file.write(line.replace('~', ''))
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
if 0 == RunCommand(diff_cmd, exit_code=True, print_cmd=gflags.FLAGS.verbose):
if 0 == RunCommand(diff_cmd, exit_code=True, redirect_stdout=True, redirect_stderr=True, print_cmd=gflags.FLAGS.verbose):
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
all = gflags.FLAGS.all
def main(argv): try: argv = gflags.FLAGS(argv) if len(argv) != 2: _PrintUsageAndDie('Must specify a valid command') else: command = argv[1] except gflags.FlagsError, e : _PrintUsageAndDie(str(e)) package_list = gflags.FLAGS.packages.split() _CheckSaneArguments(package_list, command) overlays = { '%s/private-overlays/...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
_BuildEBuildDictionary(overlays, all, package_list)
_BuildEBuildDictionary(overlays, gflags.FLAGS.all, package_list)
def main(argv): try: argv = gflags.FLAGS(argv) if len(argv) != 2: _PrintUsageAndDie('Must specify a valid command') else: command = argv[1] except gflags.FlagsError, e : _PrintUsageAndDie(str(e)) package_list = gflags.FLAGS.packages.split() _CheckSaneArguments(package_list, command) overlays = { '%s/private-overlays/...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
if not os.path.exists(overlay): continue
if not os.path.exists(overlay): continue
def main(argv): try: argv = gflags.FLAGS(argv) if len(argv) != 2: _PrintUsageAndDie('Must specify a valid command') else: command = argv[1] except gflags.FlagsError, e : _PrintUsageAndDie(str(e)) package_list = gflags.FLAGS.packages.split() _CheckSaneArguments(package_list, command) overlays = { '%s/private-overlays/...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
if not _CheckOnStabilizingBranch(): work_branch = _GitBranch(_STABLE_BRANCH_NAME) work_branch.CreateBranch() if not work_branch.Exists(): Die('Unable to create stabilizing branch in %s' % overlay)
def main(argv): try: argv = gflags.FLAGS(argv) if len(argv) != 2: _PrintUsageAndDie('Must specify a valid command') else: command = argv[1] except gflags.FlagsError, e : _PrintUsageAndDie(str(e)) package_list = gflags.FLAGS.packages.split() _CheckSaneArguments(package_list, command) overlays = { '%s/private-overlays/...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
def main(argv): try: argv = gflags.FLAGS(argv) if len(argv) != 2: _PrintUsageAndDie('Must specify a valid command') else: command = argv[1] except gflags.FlagsError, e : _PrintUsageAndDie(str(e)) package_list = gflags.FLAGS.packages.split() _CheckSaneArguments(package_list, command) overlays = { '%s/private-overlays/...
804ad7df2772bbb0df99bab523e0e6acca66ef39 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/804ad7df2772bbb0df99bab523e0e6acca66ef39/cros_mark_as_stable.py
for package in repo_dictionary[repo_name]: revisions[package] = revision_tuple[1]
if repo_dictionary.has_key(repo_name): for package in repo_dictionary[repo_name]: revisions[package] = revision_tuple[1]
def _ParseRevisionString(revision_string, repo_dictionary): """Parses the given revision_string into a revision dictionary. Returns a list of tuples that contain [portage_package_name, commit_id] to update. Keyword arguments: revision_string -- revision_string with format 'repo1.git@commit_1 repo2.git@commit2 ...'. r...
5140c15674dc908f83c07f15aa201868f1add3e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/5140c15674dc908f83c07f15aa201868f1add3e1/cbuildbot.py
def __init__(self, tests):
def __init__(self, tests, results_dir_root=None): """Constructs and initializes the test runner class. Args: tests: A list of test names (see run_remote_tests.sh). results_dir_root: The results directory root. If provided, the results directory root for each test will be created under it with the SSH port appended to ...
def __init__(self, tests): self._tests = tests
3bab0321232e7900a9e827658ca48c5797d77023 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/3bab0321232e7900a9e827658ca48c5797d77023/cros_run_parallel_vm_tests.py