bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
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...
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...
465,900
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())))
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())))
465,901
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...
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'] = self.auth_cookie_path \ or req.base_path or '/' req.outcookie['trac_auth']['expires'] = -10000 if self.env.s...
465,902
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...
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_frag = extract_link(self.env, Context.from_request(req), link) def get_fir...
465,903
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': ...
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 or not any(c['diffs'] for c in changes): self.log.warning('Invalid unified dif...
465,904
def backup(self, dest=None): """Simple SQLite-specific backup of the database.
def backup(self, dest=None): """Simple SQLite-specific backup of the database.
465,905
def process_request(self, req): req.perm.assert_permission('TIMELINE_VIEW')
def process_request(self, req): req.perm.assert_permission('TIMELINE_VIEW')
465,906
def render_ticket_action_control(self, req, ticket, action):
def render_ticket_action_control(self, req, ticket, action):
465,907
def render_ticket_action_control(self, req, ticket, action):
def render_ticket_action_control(self, req, ticket, action):
465,908
def render_ticket_action_control(self, req, ticket, action):
def render_ticket_action_control(self, req, ticket, action):
465,909
def render_ticket_action_control(self, req, ticket, action):
def render_ticket_action_control(self, req, ticket, action):
465,910
def render_ticket_action_control(self, req, ticket, action):
def render_ticket_action_control(self, req, ticket, action):
465,911
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)
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)
465,912
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)
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)
465,913
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)
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)
465,914
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)
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)
465,915
def modification_callback(file): print >> sys.stderr, 'Detected modification of %s, ' \ 'restarting.' % file
def modification_callback(file): print >> sys.stderr, 'Detected modification of %s, ' \ 'restarting.' % file
465,916
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)
def normalize_rev(self, rev): if rev is None or isinstance(rev, basestring) and \ rev.lower() in ('', 'head', 'latest', 'youngest'): return self.youngest_rev or 0 else: try: rev = int(rev) if rev <= self.youngest_rev: return rev except (ValueError, TypeError): pass raise NoSuchChangeset(rev)
465,917
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')
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')
465,918
def setUp(self): self.env = EnvironmentStub(default_data=True)
def setUp(self): self.env = EnvironmentStub(default_data=True)
465,919
def tearDown(self): # Restore the original component registry from trac.core import ComponentMeta ComponentMeta._registry = self.old_registry
def tearDown(self): # Restore the original component registry from trac.core import ComponentMeta ComponentMeta._registry = self.old_registry
465,920
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 "...
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 "...
465,921
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 "...
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 "...
465,922
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
465,923
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
465,924
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
465,925
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
def _notify(self, ticket, newticket=True, modtime=None): self.ticket = ticket self.modtime = modtime self.newticket = newticket
465,926
def write_utctime(name, value, params={}): write_prop(name, format_datetime(value, '%Y%m%dT%H%M%SZ', utc), params)
def write_utctime(name, value, params={}): write_prop(name, format_datetime(value, '%Y%m%dT%H%M%SZ', utc), params)
465,927
def render_template(self, req, filename, data, content_type=None, fragment=False): """Render the `filename` using the `data` for the context.
def render_template(self, req, filename, data, content_type=None, fragment=False): """Render the `filename` using the `data` for the context.
465,928
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 ".")')...
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 ".")')...
465,929
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...
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...
465,930
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...
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...
465,931
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...
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...
465,932
def bytotalawardmoney(n1,n2): return cmp(n1.totalawardmoney, n2.totalawardmoney)
def bytotalawardmoney(n1,n2): return cmp(n1.totalawardmoney, n2.totalawardmoney)
465,933
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...
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...
465,934
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...
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...
465,935
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....
def form_email_about_registration(request, user, profile): email_body = loader.get_template('core/registration_email.txt') 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.a...
465,936
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 = {...
def _form_email_about_password_changed(request, user, new_password): email_body = loader.get_template('core/password_reset_email.txt') 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 = { ...
465,937
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')
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')
465,938
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...
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...
465,939
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...
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...
465,940
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...
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...
465,941
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...
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...
465,942
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
def testKdSearchNN(): n = 2**8 point_list = [[i,n-i] for i in range(1,n)] 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
465,943
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
deftest2():point_list=[[i]foriinrange(1,32)]node=kdTree(point_list)node.show()print'point_list',point_listforpointinpoint_list:best=kdSearchNN(node,point,node,0)print'point=',point,',best=',best.location
465,944
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
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: point2 = [x + .4 for x in point] point2 = point best = kdSearchNN(node, point2, node, 0) print 'point =', point, 'point2 =', point2, ', best =', best.location, '***' if po...
465,945
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
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
465,946
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
def fixupTitle(): showTitle = sys.argv[1] showTitle = showTitle.lower() showTitle = showTitle.replace(' ', '_') showTitle = showTitle.replace('-', '_') showTitle = showTitle.replace(':', '') showTitle = re.sub('^the_', '', showTitle) showTitle = re.sub('two_and_a_half_men', 'two_half_men', showTitle) return showTitle
465,947
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() ...
def GlueByContents(fout, url_contents, regmemdate): ur = urllib.urlopen(url_contents) 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(u...
465,948
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() ...
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: url = urlparse.urljoin(url_contents, p.a['href']) print " reading " + url ur = urllib.urlopen(url) sr ...
465,949
def parse_day(self, fp, text, date): self.date = date
def parse_day(self, fp, text, date): self.date = date
465,950
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...
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...
465,951
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>...
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>...
465,952
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('...
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('...
465,953
def _GenerateReportText(self): """Prints a result report to stdout.
def _GenerateReportText(self): """Prints a result report to stdout.
465,954
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...
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, shell=False): """Runs a command. Keyword arguments: cmd - cmd to run. Should be input to subprocess.POpen. If a string, converted to an arra...
465,955
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...
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. print_cmd -- prints the command before ru...
465,956
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...
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...
465,957
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...
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...
465,958
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...
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...
465,959
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...
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...
465,960
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('...
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('...
465,961
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('...
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('...
465,962
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...
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...
465,963
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...
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('--enable_tablet', dest='enable_tablet', default="true", help='fixup image for qemu') (options, args) = parser.parse_args() if not options.mounted_d...
465,964
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...
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...
465,965
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...
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...
465,966
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...
def _UprevPackages(buildroot, revisionfile): revisions = None if (revisionfile): 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 pri...
465,967
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...
def setUp(self): self.mox = mox.Mox() 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(filen...
465,968
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...
def RevGitFile(filename, key, value): """Update and push the git file. def tearDown(self): self.mox.UnsetStubs() self.mox.VerifyAll()
465,969
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
465,970
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
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...
465,971
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
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
465,972
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...
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...
465,973
def testFullUpdateKeepStateful(self): """Tests if we can update normally.
def testFullUpdateKeepStateful(self): """Tests if we can update normally.
465,974
def NotestFullUpdateWipeStateful(self): """Tests if we can update after cleaning the stateful partition.
def testFullUpdateWipeStateful(self): """Tests if we can update after cleaning the stateful partition.
465,975
def NotestFullUpdateWipeStateful(self): """Tests if we can update after cleaning the stateful partition.
def NotestFullUpdateWipeStateful(self): """Tests if we can update after cleaning the stateful partition.
465,976
def _GenerateReportText(self): """Prints a result report to stdout.
def _GenerateReportText(self): """Prints a result report to stdout.
465,977
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...
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. commandWithArgs = ['%s/cros_run_vm_test' % self.crosutilsbin, '--image_path=%s' % self.vm_image_path, '--snapshot', '--persist', '--kv...
465,978
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)
def VerifyImage(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)
465,979
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...
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...
465,980
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...
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...
465,981
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...
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...
465,982
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...
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...
465,983
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...
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...
465,984
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...
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...
465,985
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...
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...
465,986
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...
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...
465,987
def GetCommitId(self): """Get the commit id for this ebuild."""
def GetCommitId(self): """Get the commit id for this ebuild."""
465,988
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
def RevEBuild(self, commit_id='', redirect_file=None): """Revs an ebuild given the git commit id.
465,989
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
465,990
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
465,991
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
def RevEBuild(self, commit_id="", redirect_file=None): """Revs an ebuild given the git commit id.
465,992
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/...
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/...
465,993
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/...
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/...
465,994
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/...
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/...
465,995
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/...
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/...
465,996
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/...
defmain(argv):try:argv=gflags.FLAGS(argv)iflen(argv)!=2:_PrintUsageAndDie('Mustspecifyavalidcommand')else:command=argv[1]exceptgflags.FlagsError,e:_PrintUsageAndDie(str(e))package_list=gflags.FLAGS.packages.split()_CheckSaneArguments(package_list,command)overlays={'%s/private-overlays/chromeos-overlay'%gflags.FLAGS.src...
465,997
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...
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...
465,998
def __init__(self, tests): self._tests = 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 ...
465,999