rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
model.set(iter, 0, "Keyboard layout: <b>%s</b>" % self.keyboard_layout_desc) | model.set(iter, 0, _("Keyboard layout: ") + "<b>%s</b>" % self.keyboard_layout_desc) | def show_overview(self): ''' build the summary page ''' model = gtk.TreeStore(str) top = model.append(None) model.set(top, 0, "Filesystem operations") top = model.append(None) model.set(top, 0, _("Localization")) iter = model.append(top) model.set(iter, 0, "Language: <b>%s</b>" % self.locale) iter = model.append(top) ... |
model.set(iter, 0, "Keyboard model: <b>%s</b>" % self.keyboard_model_desc) | model.set(iter, 0, _("Keyboard model: ") + "<b>%s</b>" % self.keyboard_model_desc) | def show_overview(self): ''' build the summary page ''' model = gtk.TreeStore(str) top = model.append(None) model.set(top, 0, "Filesystem operations") top = model.append(None) model.set(top, 0, _("Localization")) iter = model.append(top) model.set(iter, 0, "Language: <b>%s</b>" % self.locale) iter = model.append(top) ... |
model.set(iter, 0, "Real name: <b>%s</b>" % realname) | model.set(iter, 0, _("Real name: ") + "<b>%s</b>" % realname) | def show_overview(self): ''' build the summary page ''' model = gtk.TreeStore(str) top = model.append(None) model.set(top, 0, "Filesystem operations") top = model.append(None) model.set(top, 0, _("Localization")) iter = model.append(top) model.set(iter, 0, "Language: <b>%s</b>" % self.locale) iter = model.append(top) ... |
model.set(iter, 0, "Username: <b>%s</b>" % username) | model.set(iter, 0, _("Username: ") + "<b>%s</b>" % username) | def show_overview(self): ''' build the summary page ''' model = gtk.TreeStore(str) top = model.append(None) model.set(top, 0, "Filesystem operations") top = model.append(None) model.set(top, 0, _("Localization")) iter = model.append(top) model.set(iter, 0, "Language: <b>%s</b>" % self.locale) iter = model.append(top) ... |
model.set(iter, 0, "Hostname: <b>%s</b>" % self.wTree.get_widget("entry_hostname").get_text()) | model.set(iter, 0, _("Hostname: ") + "<b>%s</b>" % self.wTree.get_widget("entry_hostname").get_text()) | def show_overview(self): ''' build the summary page ''' model = gtk.TreeStore(str) top = model.append(None) model.set(top, 0, "Filesystem operations") top = model.append(None) model.set(top, 0, _("Localization")) iter = model.append(top) model.set(iter, 0, "Language: <b>%s</b>" % self.locale) iter = model.append(top) ... |
model.set(iter, 0, _("Install bootloader to %s" % ("<b>%s</b>" % grub_model[grub_active][0]))) | model.set(iter, 0, _("Install bootloader in %s") % ("<b>%s</b>" % grub_model[grub_active][0])) | def show_overview(self): ''' build the summary page ''' model = gtk.TreeStore(str) top = model.append(None) model.set(top, 0, "Filesystem operations") top = model.append(None) model.set(top, 0, _("Localization")) iter = model.append(top) model.set(iter, 0, "Language: <b>%s</b>" % self.locale) iter = model.append(top) ... |
model.set(iter, 0, "<b>%s</b>" % (_("Format %s (%s) as %s" % (item[0], item[4], item[1])))) | model.set(iter, 0, "<b>%s</b>" % (_("Format %s (%s) as %s") % (item[0], item[4], item[1]))) | def show_overview(self): ''' build the summary page ''' model = gtk.TreeStore(str) top = model.append(None) model.set(top, 0, "Filesystem operations") top = model.append(None) model.set(top, 0, _("Localization")) iter = model.append(top) model.set(iter, 0, "Language: <b>%s</b>" % self.locale) iter = model.append(top) ... |
model.set(iter, 0, "<b>%s</b>" % (_("Mount %s as %s" % (item[0], item[3])))) | model.set(iter, 0, "<b>%s</b>" % (_("Mount %s as %s") % (item[0], item[3]))) | def show_overview(self): ''' build the summary page ''' model = gtk.TreeStore(str) top = model.append(None) model.set(top, 0, "Filesystem operations") top = model.append(None) model.set(top, 0, _("Localization")) iter = model.append(top) model.set(iter, 0, "Language: <b>%s</b>" % self.locale) iter = model.append(top) ... |
self.window.show() | def __init__(self, fullscreen=False): self.resource_dir = '/usr/share/live-installer/' #self.glade = 'interface.glade' self.glade = os.path.join(self.resource_dir, 'interface.glade') self.wTree = gtk.glade.XML(self.glade, 'main_window') | |
color = style.bg[gtk.STATE_NORMAL] color2 = style.fg[gtk.STATE_NORMAL] | def __init__(self, fullscreen=False): self.resource_dir = '/usr/share/live-installer/' #self.glade = 'interface.glade' self.glade = os.path.join(self.resource_dir, 'interface.glade') self.wTree = gtk.glade.XML(self.glade, 'main_window') | |
self.wTree.get_widget("eventbox1").modify_bg(gtk.STATE_NORMAL, color) | self.wTree.get_widget("eventbox1").realize() self.wTree.get_widget("eventbox1").modify_bg(gtk.STATE_NORMAL, style.bg[gtk.STATE_NORMAL]) self.wTree.get_widget("eventbox1").modify_bg(gtk.STATE_ACTIVE, style.bg[gtk.STATE_ACTIVE]) | def __init__(self, fullscreen=False): self.resource_dir = '/usr/share/live-installer/' #self.glade = 'interface.glade' self.glade = os.path.join(self.resource_dir, 'interface.glade') self.wTree = gtk.glade.XML(self.glade, 'main_window') |
self.wTree.get_widget("help_label").modify_fg(gtk.STATE_NORMAL, color2) | self.wTree.get_widget("help_label").realize() self.wTree.get_widget("help_label").modify_fg(gtk.STATE_NORMAL, style.fg[gtk.STATE_NORMAL]) | def __init__(self, fullscreen=False): self.resource_dir = '/usr/share/live-installer/' #self.glade = 'interface.glade' self.glade = os.path.join(self.resource_dir, 'interface.glade') self.wTree = gtk.glade.XML(self.glade, 'main_window') |
page.breadcrumb_label.modify_fg(gtk.STATE_NORMAL, color2) | page.breadcrumb_label.modify_fg(gtk.STATE_NORMAL, style.fg[gtk.STATE_NORMAL]) | def __init__(self, fullscreen=False): self.resource_dir = '/usr/share/live-installer/' #self.glade = 'interface.glade' self.glade = os.path.join(self.resource_dir, 'interface.glade') self.wTree = gtk.glade.XML(self.glade, 'main_window') |
self.window.show_all() | def __init__(self, fullscreen=False): self.resource_dir = '/usr/share/live-installer/' #self.glade = 'interface.glade' self.glade = os.path.join(self.resource_dir, 'interface.glade') self.wTree = gtk.glade.XML(self.glade, 'main_window') | |
if partition.getFlag(parted.PARTITION_SWAP): | if partition.type == parted.PARTITION_SWAP: | def __init__(self, partition): self.partition = partition self.size = partition.getSize() self.start = partition.geometry.start self.end = partition.geometry.end self.description = "" self.used_space = "" if partition.number != -1: self.name = partition.path if partition.fileSystem is None: # no filesystem, check flag... |
elif partition.getFlag(parted.PARTITION_RAID): | elif partition.type == parted.PARTITION_RAID: | def __init__(self, partition): self.partition = partition self.size = partition.getSize() self.start = partition.geometry.start self.end = partition.geometry.end self.description = "" self.used_space = "" if partition.number != -1: self.name = partition.path if partition.fileSystem is None: # no filesystem, check flag... |
elif partition.getFlag(parted.PARTITION_LVM): | elif partition.type == parted.PARTITION_LVM: | def __init__(self, partition): self.partition = partition self.size = partition.getSize() self.start = partition.geometry.start self.end = partition.geometry.end self.description = "" self.used_space = "" if partition.number != -1: self.name = partition.path if partition.fileSystem is None: # no filesystem, check flag... |
elif partition.getFlag(parted.PARTITION_HPSERVICE): | elif partition.type == parted.PARTITION_HPSERVICE: | def __init__(self, partition): self.partition = partition self.size = partition.getSize() self.start = partition.geometry.start self.end = partition.geometry.end self.description = "" self.used_space = "" if partition.number != -1: self.name = partition.path if partition.fileSystem is None: # no filesystem, check flag... |
elif partition.getFlag(parted.PARTITION_PALO): | elif partition.type == parted.PARTITION_PALO: | def __init__(self, partition): self.partition = partition self.size = partition.getSize() self.start = partition.geometry.start self.end = partition.geometry.end self.description = "" self.used_space = "" if partition.number != -1: self.name = partition.path if partition.fileSystem is None: # no filesystem, check flag... |
elif partition.getFlag(parted.PARTITION_PREP): | elif partition.type == parted.PARTITION_PREP: | def __init__(self, partition): self.partition = partition self.size = partition.getSize() self.start = partition.geometry.start self.end = partition.geometry.end self.description = "" self.used_space = "" if partition.number != -1: self.name = partition.path if partition.fileSystem is None: # no filesystem, check flag... |
elif partition.getFlag(parted.PARTITION_MSFT_RESERVED): | elif partition.type == parted.PARTITION_MSFT_RESERVED: | def __init__(self, partition): self.partition = partition self.size = partition.getSize() self.start = partition.geometry.start self.end = partition.geometry.end self.description = "" self.used_space = "" if partition.number != -1: self.name = partition.path if partition.fileSystem is None: # no filesystem, check flag... |
elif partition.getFlag(parted.PARTITION_EXTENDED): | elif partition.type == parted.PARTITION_EXTENDED: | def __init__(self, partition): self.partition = partition self.size = partition.getSize() self.start = partition.geometry.start self.end = partition.geometry.end self.description = "" self.used_space = "" if partition.number != -1: self.name = partition.path if partition.fileSystem is None: # no filesystem, check flag... |
elif partition.getFlag(parted.PARTITION_LOGICAL): | elif partition.type == parted.PARTITION_LOGICAL: | def __init__(self, partition): self.partition = partition self.size = partition.getSize() self.start = partition.geometry.start self.end = partition.geometry.end self.description = "" self.used_space = "" if partition.number != -1: self.name = partition.path if partition.fileSystem is None: # no filesystem, check flag... |
elif partition.getFlag(parted.PARTITION_FREESPACE): | elif partition.type == parted.PARTITION_FREESPACE: | def __init__(self, partition): self.partition = partition self.size = partition.getSize() self.start = partition.geometry.start self.end = partition.geometry.end self.description = "" self.used_space = "" if partition.number != -1: self.name = partition.path if partition.fileSystem is None: # no filesystem, check flag... |
root_device = item item.format = True if(item.format != ""): | root_device = item if(item.format is not None and item.format != ""): | def install(self): ''' Install this baby to disk ''' # mount the media location. print " --> Installation started" try: if(not os.path.exists("/target")): os.mkdir("/target") if(not os.path.exists("/source")): os.mkdir("/source") # find the squashfs.. root = self.media root_type = self.media_type if(not os.path.exists(... |
def add_mount(self, device=None, mountpoint=None, filesystem=None, options=None,format=False): | def add_mount(self, device=None, mountpoint=None, filesystem=None, options=None,format=""): | def add_mount(self, device=None, mountpoint=None, filesystem=None, options=None,format=False): if(not self.mapping.has_key(device)): self.mapping[device] = fstab_entry(device, mountpoint, filesystem, options) self.mapping[device].format = format |
gtk.gdk.threads_leave() | def build_disks(self): import subprocess self.disks = {} inxi = subprocess.Popen("inxi -c0 -D", shell=True, stdout=subprocess.PIPE) parent = None for line in inxi.stdout: line = line.rstrip("\r\n") if(line.startswith("Disks:")): line = line.replace("Disks:", "") device = None sections = line.split(":") for section in s... | |
gtk.gdk.threads_leave() | def build_partitions(self): self.window.set_sensitive(False) # "busy" cursor. cursor = gtk.gdk.Cursor(gtk.gdk.WATCH) self.window.window.set_cursor(cursor) from progress import ProgressDialog dialog = ProgressDialog() dialog.show(title=_("Installer"), label=_("Scanning disk %s for partitions") % self.device_node) impor... | |
gtk.gdk.threads_enter() | def build_partitions(self): self.window.set_sensitive(False) # "busy" cursor. cursor = gtk.gdk.Cursor(gtk.gdk.WATCH) self.window.window.set_cursor(cursor) from progress import ProgressDialog dialog = ProgressDialog() dialog.show(title=_("Installer"), label=_("Scanning disk %s for partitions") % self.device_node) impor... | |
self.wTree.get_widget("combobox_grub").set_active(0) | self.wTree.get_widget("combobox_grub").set_active(0) gtk.gdk.threads_leave() | def build_partitions(self): self.window.set_sensitive(False) # "busy" cursor. cursor = gtk.gdk.Cursor(gtk.gdk.WATCH) self.window.window.set_cursor(cursor) from progress import ProgressDialog dialog = ProgressDialog() dialog.show(title=_("Installer"), label=_("Scanning disk %s for partitions") % self.device_node) impor... |
elif(self == self.PAGE_OVERVIEW): | elif(sel == self.PAGE_OVERVIEW): | def wizard_cb(self, widget, goback, data=None): ''' wizard buttons ''' sel = self.wTree.get_widget("notebook1").get_current_page() # check each page for errors if(not goback): if(sel == self.PAGE_LANGUAGE): self.activate_page(self.PAGE_KEYBOARD) elif(sel == self.PAGE_KEYBOARD): self.activate_page(self.PAGE_PARTITIONS) ... |
gtk.gdk.threads_enter() | def pbar_pulse(): if(not self.should_pulse): return False self.wTree.get_widget("progressbar").pulse() return self.should_pulse | |
gtk.gdk.threads_leave() | def pbar_pulse(): if(not self.should_pulse): return False self.wTree.get_widget("progressbar").pulse() return self.should_pulse | |
self.configure_grub() | self.configure_grub(our_total, our_current) | def install(self): ''' Install this baby to disk ''' # mount the media location. print " --> Installation started" try: if(not os.path.exists("/target")): os.mkdir("/target") if(not os.path.exists("/source")): os.mkdir("/source") # find the squashfs.. root = self.media root_type = self.media_type if(not os.path.exists(... |
while (not self.check_grub()): self.configure_grub() | while (not self.check_grub(our_total, our_current)): self.configure_grub(our_total, our_current) | def install(self): ''' Install this baby to disk ''' # mount the media location. print " --> Installation started" try: if(not os.path.exists("/target")): os.mkdir("/target") if(not os.path.exists("/source")): os.mkdir("/source") # find the squashfs.. root = self.media root_type = self.media_type if(not os.path.exists(... |
def configure_grub(self): | def configure_grub(self, our_total, our_current): | def configure_grub(self): self.update_progress(pulse=True, total=our_total, current=our_current, message=_("Configuring bootloader")) print " --> Running grub-mkconfig" self.run_in_chroot("grub-mkconfig -o /boot/grub/grub.cfg") |
def check_grub(self): | def check_grub(self, our_total, our_current): | def check_grub(self): self.update_progress(pulse=True, total=our_total, current=our_current, message=_("Checking bootloader")) print " --> Checking Grub configuration" time.sleep(2) found_theme = False found_entry = False grubfh = open("/boot/grub/grub.cfg", "r") for line in grubfh: line = line.rstrip("\r\n") if("/boot... |
PATH = "%s/share/" % PREFIX | PATH = "%s/share/doc/specto/" % PREFIX | def get_path(category=None): """ Return the correct path. """ if not os.path.exists('data') or not os.path.exists('spectlib'): if not category: PATH = "%s/share/specto/" % PREFIX elif category=="doc": PATH = "%s/share/" % PREFIX elif category=="src": PATH = os.path.dirname(os.path.abspath(__file__)) else: if not catego... |
%s/share/specto/icons/hicolor''' % prefix | %s/share/icons/hicolor''' % prefix | def give_files(dir, *extension): files=[] all_files=os.listdir(dir) for file in all_files: ext=(os.path.splitext(file))[1] if ext in extension: files.append(dir + file) return files |
('share/specto/glade', give_files('data/glade/', '.glade')), | ('share/specto/uis', give_files('data/uis/', '.ui')), | def give_mo_tuples(langs): mo_tuple_list=[] for lang in langs.split(' '): mo_tuple_list.append((give_mo_path(lang), [give_mo_file(lang)])) return mo_tuple_list |
SID = greader.login() feed_db = greader.get_unread_items(SID) | auth = greader.login() feed_db = greader.get_unread_items(auth) | def check(self): """ Check for new news on your greader account. """ try: self.newMsg = 0 self.unreadMsg = 0 greader = Greader(self.username, self.password, "specto") SID = greader.login() feed_db = greader.get_unread_items(SID) for feed in feed_db: self.unreadMsg += feed.messages if feed.messages > 0 and self.news_inf... |
return re.search('SID=(\S*)', result).group(1) | return re.search('Auth=(\S*)', result).group(1) | def login(self): #login / get SED header = {'User-agent' : self.source} post_data = urllib.urlencode({ 'Email': self.user, 'Passwd': self.password, 'service': 'reader', 'source': self.source, 'continue': self.google_url, }) request = urllib2.Request(self.login_url, post_data, header) try : f = urllib2.urlopen( request... |
def get_results(self, SID, url): | def get_results(self, auth, url): | def get_results(self, SID, url): #get results from url header = {'User-agent' : self.source} header['Cookie']='Name=SID;SID=%s;Domain=.google.com;Path=/;Expires=160000000000' % SID request = urllib2.Request(url, None, header) try : f = urllib2.urlopen( request ) result = f.read() except: raise Exception('Error getti... |
header['Cookie']='Name=SID;SID=%s;Domain=.google.com;Path=/;Expires=160000000000' % SID | header['Authorization']='GoogleLogin auth=%s' % auth | def get_results(self, SID, url): #get results from url header = {'User-agent' : self.source} header['Cookie']='Name=SID;SID=%s;Domain=.google.com;Path=/;Expires=160000000000' % SID request = urllib2.Request(url, None, header) try : f = urllib2.urlopen( request ) result = f.read() except: raise Exception('Error getti... |
def get_unread_items(self, SID): | def get_unread_items(self, auth): | def get_unread_items(self, SID): feed_db = [] data = self.get_results(SID, self.read_items_url) feed_data = self.list_feeds(SID) node = ET.XML(data) feed_node = ET.XML(feed_data) total_unread = 0 node = node.find("list") feed_node = feed_node.find("list") for o in node.findall("object"): feed = "" total_unread = 0 fee... |
data = self.get_results(SID, self.read_items_url) feed_data = self.list_feeds(SID) | data = self.get_results(auth, self.read_items_url) feed_data = self.list_feeds(auth) | def get_unread_items(self, SID): feed_db = [] data = self.get_results(SID, self.read_items_url) feed_data = self.list_feeds(SID) node = ET.XML(data) feed_node = ET.XML(feed_data) total_unread = 0 node = node.find("list") feed_node = feed_node.find("list") for o in node.findall("object"): feed = "" total_unread = 0 fee... |
return self.notifier.flags() & gtk.VISIBLE | return bool(self.notifier.flags() & gtk.VISIBLE) | def get_state(self): """ Return True if the notifier window is visible. """ return self.notifier.flags() & gtk.VISIBLE |
self.playing = False | def __init__(self): self.player = None | |
open = True | use_standard_command = True | def add_clicked(self, widget): """ Add the watch to the watches repository. """ values = {} #get the standard options from a watch values['name'] = self.name.get_text() |
if open == True: | if use_standard_command: | def add_clicked(self, widget): """ Add the watch to the watches repository. """ values = {} #get the standard options from a watch values['name'] = self.name.get_text() |
Watch class that will check if you recevied a new mail on your pop3 account. | Watch class that will check if you recevied a new mail on your IMAP account. | def get_add_gui_info(): return [("username", spectlib.gtkconfig.Entry(_("Username"))), ("password", spectlib.gtkconfig.PasswordEntry(_("Password"))), ("host", spectlib.gtkconfig.Entry(_("Host"))), ("ssl", spectlib.gtkconfig.CheckButton(_("Use SSL"))), ("folder", spectlib.gtkconfig.Entry(_("Folder (optional)")))] |
PATH = "%s/share/specto/" % sys.prefix | PATH = "%s/share/specto/" % PREFIX | def get_path(category=None): """ Return the correct path. """ if not os.path.exists('data') or not os.path.exists('spectlib'): if not category: PATH = "%s/share/specto/" % sys.prefix elif category=="doc": PATH = "%s/share/doc/specto/" % sys.prefix elif category=="src": PATH = os.path.dirname(os.path.abspath(__file__)) ... |
PATH = "%s/share/doc/specto/" % sys.prefix | PATH = "%s/share/" % PREFIX | def get_path(category=None): """ Return the correct path. """ if not os.path.exists('data') or not os.path.exists('spectlib'): if not category: PATH = "%s/share/specto/" % sys.prefix elif category=="doc": PATH = "%s/share/doc/specto/" % sys.prefix elif category=="src": PATH = os.path.dirname(os.path.abspath(__file__)) ... |
PATH = os.path.join(os.getcwd(), "data/doc/") | PATH = os.path.join(os.getcwd(), "") | def get_path(category=None): """ Return the correct path. """ if not os.path.exists('data') or not os.path.exists('spectlib'): if not category: PATH = "%s/share/specto/" % sys.prefix elif category=="doc": PATH = "%s/share/doc/specto/" % sys.prefix elif category=="src": PATH = os.path.dirname(os.path.abspath(__file__)) ... |
return '%s/%s' % (THEME_URL, self.directory) | return '%s/%s' % (theme_url, self.directory) | def base_url(self): return '%s/%s' % (THEME_URL, self.directory) |
map(lambda (k,v): k + "," + v), hints) | map(lambda (k,v): k + "," + v, hintCopy.items())) | def __init__(self, query, hints, pmap, reportError, resultName=""): self.queryStr = query.strip()# Pull trailing whitespace # Force semicolon to facilitate worker-side splitting if self.queryStr[-1] != ";": # Add terminal semicolon self.queryStr += ";" self.queryHash = hashlib.md5(self.queryStr).hexdigest()[:18] self.... |
qConfig["table.defaultDb"] = self._dbContext | qConfig["table.defaultdb"] = self._dbContext | def __init__(self, query, hints, pmap, reportError, resultName=""): self.queryStr = query.strip()# Pull trailing whitespace # Force semicolon to facilitate worker-side splitting if self.queryStr[-1] != ";": # Add terminal semicolon self.queryStr += ";" self.queryHash = hashlib.md5(self.queryStr).hexdigest()[:18] self.... |
print "Chunk %d to %s (%s)" % (chunk, saveName, table) | def submit(self, chunk, table, q): saveName = self._saveName(chunk) handle = submitQuery(self._sessionId, chunk, q, saveName, table) self._inFlight[chunk] = (handle, table) print "Chunk %d to %s (%s)" % (chunk, saveName, table) | |
print "Affected chunks: ", [x[0] for x in self._intersectIter] | def _evaluateHints(self, hints, pmap): """Modify self.fullSky and self.partitionCoverage according to spatial hints""" self._isFullSky = True self._intersectIter = pmap self._dbContext = "LSST" ## FIXME. should be configurable if hints: regions = self._parseRegions(hints) self._dbContext = hints.get("db", "") ids = hin... | |
map(lambda (k,v): k + "," + v), hints)) | map(lambda (k,v): k + "," + v), hints) | def __init__(self, query, hints, pmap, reportError, resultName=""): self.queryStr = query.strip()# Pull trailing whitespace # Force semicolon to facilitate worker-side splitting if self.queryStr[-1] != ";": # Add terminal semicolon self.queryStr += ";" self.queryHash = hashlib.md5(self.queryStr).hexdigest()[:18] self.... |
query += self._substitution.transform(ref) | query += self._substitution.substituteOnly(ref) | def _makeChunkQuery(self, chunkId, table): # Prefix with empty subchunk spec. query = self._headerFunc() +"\n" ref = self._pConfig.chunkMapping.getMapReference(chunkId,0) query += self._createTableTmpl % table query += self._substitution.transform(ref) print query return query |
q = self._substitution.transform(ref) q = self._fixSubChunkDb(q, chunkId, subChunkId) | q = self._substitution.transform(ref, chunkId, subChunkId) | def _makeSubChunkQuery(self, chunkId, subIter, table): qList = [None] # Include placeholder for header scList = None # Extract list first. if self._isFullSky: scList = [x for x in subIter] else: scList = [sub for (sub, regions) in subIter] |
if s != "success": | resStr = getQueryStateString(s) if resStr != "success": | def finish(self): for (k,v) in self._inFlight.items(): s = tryJoinQuery(self._sessionId, v[0]) print "State of", k, "is", getQueryStateString(s) |
print "Final state of all queries", getQueryStateString(s) | print "Final state of all queries", resStr | def finish(self): for (k,v) in self._inFlight.items(): s = tryJoinQuery(self._sessionId, v[0]) print "State of", k, "is", getQueryStateString(s) |
if options.resettables == True: resetTables() return elif options.test == True: | if options.test == True: | def main(): parser = OptionParser() # Db-backed task tracking is not supported right now. # parser.add_option("--reset-tables", action="store_true", # dest="resettables", default=False, # help="Reset tables instead of starting the server ()") parser.add_option("-t", "--test", action... |
self._brokenChunks.append(p) | self._brokenChunks.append(c) | def _joinAll(self): for (c,xo) in self.running.items(): xo.join() t = self.running.pop(c) self.finished[c] = t.successful if not xo.successful: print "Unsuccessful with %s on chunk %d" % (self.queryStr, c) self._brokenChunks.append(p) # discard thread object. |
length = i * nominal | length = nominal | def _move(self): chunkCount = len(self._chunkFiles) nominal, extra = divmod(chunkCount, self._opts.dirs) print chunkCount, "in dirs with at least", nominal start = 0 |
self._slowDispatchTime = 0.3 | self._slowDispatchTime = 0.5 | def __init__(self, query): self.queryStr = query.strip()# Pull trailing whitespace # Force semicolon to facilitate worker-side splitting if self.queryStr[-1] != ";": # Add terminal semicolon self.queryStr += ";" self.queryMunger = None ## sqlparser.QueryMunger() self.db = Persistence() self.running = {} self.resultLo... |
triedAgain = False | def invoke(self): print "Query invoking..." stats = time.qServQueryTimer[time.qServRunningName] stats["queryActionStart"] = time.time() self.queryMunger = sqlparser.QueryMunger(self.queryStr) # 64bit hash is enough for now(testing). self.queryHash = hashlib.md5(self.queryStr).hexdigest()[:16] self.resultPath = self.set... | |
print "Slow dispatch detected. Draining all queries," self._progressiveJoinAll() print "Cooling down for %d seconds." % self._coolDownTime time.sleep(self._coolDownTime) print "Back to work!" | if triedAgain: print "Slow dispatch detected. Draining all queries," self._progressiveJoinAll() print "Cooling down for %d seconds." % self._coolDownTime time.sleep(self._coolDownTime) print "Back to work!" triedAgain = True | def invoke(self): print "Query invoking..." stats = time.qServQueryTimer[time.qServRunningName] stats["queryActionStart"] = time.time() self.queryMunger = sqlparser.QueryMunger(self.queryStr) # 64bit hash is enough for now(testing). self.queryHash = hashlib.md5(self.queryStr).hexdigest()[:16] self.resultPath = self.set... |
cursor.execute("""INSERT INTO burp(machinename, port, rundate, | if aucreated[auid] is not None: cursor.execute("""INSERT INTO burp(machinename, port, rundate, | def _article_report(client, db, options): auids, auname = _get_auids(client) host, port = options.host.split(':',1) auyear = {} austatus = {} aucreated = {} aulastcrawlresult = {} aucontentsize = {} audisksize = {} aurepository = {} auarticles = {} cursor = db.cursor() for auid in auids: rerun = True numRuns = 0 while ... |
else: cursor.execute("""INSERT INTO burp(machinename, port, rundate, auname, auid, auyear, austatus, aulastcrawlresult, aucontentsize, audisksize, aurepository, numarticles, publisher, created) VALUES ("%s", "%s", NOW(), "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "default", NULL)""" % \ (host, port, auname[... | def _article_report(client, db, options): auids, auname = _get_auids(client) host, port = options.host.split(':',1) auyear = {} austatus = {} aucreated = {} aulastcrawlresult = {} aucontentsize = {} audisksize = {} aurepository = {} auarticles = {} cursor = db.cursor() for auid in auids: rerun = True numRuns = 0 while ... | |
return saxutils.escape(str).decode('utf-8').encode('ascii', 'xmlcharrefreplace') | return saxutils.escape(str).replace('"', ''').decode('utf-8').encode('ascii', 'xmlcharrefreplace') | def __escape(str): from xml.sax import saxutils return saxutils.escape(str).decode('utf-8').encode('ascii', 'xmlcharrefreplace') |
'outer': '"' if current_pub.name().find('\'') < 0 else '\'', 'inner': '\'' if current_pub.name().find('\'') < 0 else '"' } | 'outer': '"' if "'" not in current_pub.name() else "'", 'inner': "'" if "'" not in current_pub.name() else '"' } | def __process(tdb, options): current_pub = None if options.style == TdbxmlConstants.OPTION_STYLE_LEGACY: print '''\ <property name="org.lockss.title"> |
if options.headings: result = [[w.capitalize() for w in fields]] + result | if options.names: result = [[w.capitalize() for w in fields]] + result | def __process(tdb, options): fields = options.fields.split(',') result = [[lam(au) or '' for lam in map(tdbq.str_to_lambda_au, fields)] for au in tdb.aus()] if options.style == TdboutConstants.OPTION_STYLE_CSV: import csv if options.headings: result = [[w.capitalize() for w in fields]] + result if options.warnings: fro... |
fileInconsistent.write("\n") | fileInconsistent.write("\n\n") | def _find_inconsistent_information(db, options): fileInconsistent = open(options.inconsistent, 'w') isBlankReport = True cursor = db.cursor() cursorMachine = db.cursor() cursor2 = db.cursor() cursor3 = db.cursor() print("Looking for inconsistent information within one run.\n") cursor.execute("SELE... |
timesincecreated = datetime.now() - notcrawled[2]; if timesincecreated > datetime.timedelta(OPTION_DAYS_WITHOUT_CRAWL_DEFAULT): fileInconsistent.write("`%s' has been waiting too long for a successful crawl on %s:%d." % | timeSinceCreated = datetime.now() - notcrawled[2]; if timeSinceCreated > timedelta(OPTION_DAYS_WITHOUT_CRAWL_DEFAULT): fileInconsistent.write("`%s' has been waiting too long for a successful crawl on %s:%d.\n" % | def _find_inconsistent_information(db, options): fileInconsistent = open(options.inconsistent, 'w') isBlankReport = True cursor = db.cursor() cursorMachine = db.cursor() cursor2 = db.cursor() cursor3 = db.cursor() print("Looking for inconsistent information within one run.\n") cursor.execute("SELE... |
fileInconsistent.write("The AU '%s' was known by %s:%d in the previous run, but not in the current run." % | fileInconsistent.write("The AU '%s' was known by %s:%d in the previous run, but not in the current run.\n" % | def _find_inconsistent_information(db, options): fileInconsistent = open(options.inconsistent, 'w') isBlankReport = True cursor = db.cursor() cursorMachine = db.cursor() cursor2 = db.cursor() cursor3 = db.cursor() print("Looking for inconsistent information within one run.\n") cursor.execute("SELE... |
<property name="xpath" value="[attributes/publisher='%(publisher2)s']" /> | <property name="xpath" value=%(outer)s[attributes/publisher=%(inner)s%(publisher2)s%(inner)s]%(outer)s /> | def _process(tdb, options): current_pub = None if options.style == TDB_STYLE_XML_LEGACY: print '''\ <property name="org.lockss.title"> |
'publisher2': re.sub(r'\'', ''', _escape(current_pub.name())) } | 'publisher2': re.sub(r'\'', ''', _escape(current_pub.name())), 'outer': '"' if current_pub.name().find('\'') < 0 else '\'', 'inner': '\'' if current_pub.name().find('\'') < 0 else '"' } | def _process(tdb, options): current_pub = None if options.style == TDB_STYLE_XML_LEGACY: print '''\ <property name="org.lockss.title"> |
''' % { 'publisher': __escape(current_pub.name()), | ''' % { 'publisher': __escape(current_pub.name().replace('.', '')), | def __process(tdb, options): current_pub = None if options.style == TdbxmlConstants.OPTION_STYLE_LEGACY: print '''\ <property name="org.lockss.title"> |
cursor.execute("SELECT publisher, auyear FROM burpreport group by publisher, auyear;") | cursor.execute("SELECT publisher, auyear FROM burpreport WHERE auyear != '0' GROUP BY publisher, auyear;") | def _find_inconsistent_information(db, options): fileInconsistent = open(options.inconsistent, 'w') isEmpty = True cursor = db.cursor() cursorMachine = db.cursor() cursor2 = db.cursor() cursor3 = db.cursor() cursor.execute("SELECT auid, auname FROM burp WHERE rundate >= '" + str(options.reportdate... |
cursor2.execute("SELECT MAX(numarticles), rundate FROM burpreport WHERE publisher = '%s' AND year = %d" % (arPublisherYear[0], arPublisherYear[1])) | cursor2.execute("SELECT MAX(numarticles), rundate FROM burpreport WHERE publisher = '%s' AND auyear = '%s'" % (arPublisherYear[0], arPublisherYear[1])) | def _find_inconsistent_information(db, options): fileInconsistent = open(options.inconsistent, 'w') isEmpty = True cursor = db.cursor() cursorMachine = db.cursor() cursor2 = db.cursor() cursor3 = db.cursor() cursor.execute("SELECT auid, auname FROM burp WHERE rundate >= '" + str(options.reportdate... |
cursor3.execute("SELECT numarticles FROM burpreport WHERE publisher = '%s' AND year = %d ORDER BY rundate DESC" % (arPublisherYear[0], arPublisherYear[1])) | cursor3.execute("SELECT numarticles FROM burpreport WHERE publisher = '%s' AND auyear = '%s' ORDER BY rundate DESC" % (arPublisherYear[0], arPublisherYear[1])) | def _find_inconsistent_information(db, options): fileInconsistent = open(options.inconsistent, 'w') isEmpty = True cursor = db.cursor() cursorMachine = db.cursor() cursor2 = db.cursor() cursor3 = db.cursor() cursor.execute("SELECT auid, auname FROM burp WHERE rundate >= '" + str(options.reportdate... |
fileInconsistent.write("Publisher %s in year %d has seen its total number of articles decrease from %d (in report generated on %s) to %d.\n" % (arPublisherYear[0], arPublisherYear[1], highestInYear[0], highestInYear[1].strftime("%d-%b-%Y"), mostRecent)) | fileInconsistent.write("Publisher %s in year %s has seen its total number of articles decrease from %d (in report generated on %s) to %d.\n" % (arPublisherYear[0], arPublisherYear[1], highestInYear[0], highestInYear[1].strftime("%d-%b-%Y"), mostRecent[0])) | def _find_inconsistent_information(db, options): fileInconsistent = open(options.inconsistent, 'w') isEmpty = True cursor = db.cursor() cursorMachine = db.cursor() cursor2 = db.cursor() cursor3 = db.cursor() cursor.execute("SELECT auid, auname FROM burp WHERE rundate >= '" + str(options.reportdate... |
fileInconsistent.write("Congratulations: no AU has inconsistent data!") | fileInconsistent.write("Congratulations: no AU has inconsistent data!\n") | def _find_inconsistent_information(db, options): fileInconsistent = open(options.inconsistent, 'w') isEmpty = True cursor = db.cursor() cursorMachine = db.cursor() cursor2 = db.cursor() cursor3 = db.cursor() cursor.execute("SELECT auid, auname FROM burp WHERE rundate >= '" + str(options.reportdate... |
print "startExecution = %s" % (startExecution, ) | def _article_report(client, db, options): auids, auname = _get_auids(client) host, port = options.host.split(':',1) auyear = {} austatus = {} aucreated = {} aulastcrawlresult = {} aucontentsize = {} audisksize = {} aurepository = {} auarticles = {} cursor = db.cursor() cursorStarted = db.cursor() cursorStarted.execute... | |
if (arRunDate is not None) and (arRunDate[0] > startExecution): print("Skipping: This AU was last recorded on %s, and the execution started on %s." % (time.strftime("%Y-%m-%d %H:%M:%S", arRunDate[0]), time.strftime("%Y-%m-%d %H:%M:%S", startExecution))) | if (arRunDate is None) or (arRunDate[0] is None): arRunDate = [datetime.datetime(1900, 1, 1)] if (arRunDate[0] > startExecution): print("Skipping: This AU was last recorded on %s." % (arRunDate[0].strftime("%Y-%m-%d %H:%M:%S"),)) print("The execution started on %s." % (startExecution.strftime("%Y-%m-%d %H:%M:%S"),)) | def _article_report(client, db, options): auids, auname = _get_auids(client) host, port = options.host.split(':',1) auyear = {} austatus = {} aucreated = {} aulastcrawlresult = {} aucontentsize = {} audisksize = {} aurepository = {} auarticles = {} cursor = db.cursor() cursorStarted = db.cursor() cursorStarted.execute... |
total['rsp'][strYear] += articles[0] | total['rsp'] += articles[0] | def _main_procedure(): parser = _make_command_line_parser() (options, args) = parser.parse_args(values=parser.get_default_values()) _check_required_options(parser, options) db = MySQLdb.connect(host="localhost", user="edwardsb", passwd=options.dbpassword, db="burp") _update_required_options(db, options) # Initialize ... |
_print_summary_line(summary, "Co-Action Publishing", currentyear, pubyear, total) | _print_summary_line(summary, "Co-Action Publishing", "cap", currentyear, pubyear, total) | def _main_procedure(): parser = _make_command_line_parser() (options, args) = parser.parse_args(values=parser.get_default_values()) _check_required_options(parser, options) db = MySQLdb.connect(host="localhost", user="edwardsb", passwd=options.dbpassword, db="burp") _update_required_options(db, options) # Initialize ... |
_print_summary_line(summary, "Georg Thieme Verlag", currentyear, pubyear, total) | _print_summary_line(summary, "Georg Thieme Verlag", "gtv", currentyear, pubyear, total) | def _main_procedure(): parser = _make_command_line_parser() (options, args) = parser.parse_args(values=parser.get_default_values()) _check_required_options(parser, options) db = MySQLdb.connect(host="localhost", user="edwardsb", passwd=options.dbpassword, db="burp") _update_required_options(db, options) # Initialize ... |
_print_summary_line(summary, "Royal Society Publishing", "rs", currentyear, pubyear, total) | _print_summary_line(summary, "Royal Society Publishing", "rsp", currentyear, pubyear, total) | def _main_procedure(): parser = _make_command_line_parser() (options, args) = parser.parse_args(values=parser.get_default_values()) _check_required_options(parser, options) db = MySQLdb.connect(host="localhost", user="edwardsb", passwd=options.dbpassword, db="burp") _update_required_options(db, options) # Initialize ... |
_print_summary_line(summary, "Society for the Study of Reproduction", currentyear, pubyear, total) | _print_summary_line(summary, "Society for the Study of Reproduction", "ssr", currentyear, pubyear, total) | def _main_procedure(): parser = _make_command_line_parser() (options, args) = parser.parse_args(values=parser.get_default_values()) _check_required_options(parser, options) db = MySQLdb.connect(host="localhost", user="edwardsb", passwd=options.dbpassword, db="burp") _update_required_options(db, options) # Initialize ... |
callback=__synonym_csv) | callback=__synonym_list) | def __synonym_list(opt, str, val, par): if getattr(par.values, TdboutConstants.OPTION_STYLE, None): par.error('cannot specify -%s and -%s together' % (TdboutConstants.OPTION_LIST_SHORT, TdboutConstants.OPTION_STYLE_SHORT)) setattr(par.values, TdboutConstants.OPTION_STYLE, TdboutConstants.OPTION_STYLE_LIST) setattr(par.... |
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) | VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) | def db_len(uistr, maxlen): if uistr is None: return None if len(uistr) > maxlen: __log('Warning: String is over %d characters long: %s' % (maxlen, uistr), options) return uistr[0:maxlen] |
(auid.find("ClockssBerkeleyElectronicPressPlugin") != -1) or | def _is_reported(auid): # If you change this list, be sure to change the equivalent list # in BurpReport.py. return ( ((auid.find("ClockssHighWirePlugin") != -1) and (auid.find("aappublications") != -1)) or ((auid.find("ClockssHighWirePlugin") != -1) and (auid.find("ama-assn") != -1)) or ((auid.find("ClockssHighWireP... | |
(auid[0].find("ClockssGeorgThiemeVerlagPlugin") != -1) or | (auid.find("ClockssGeorgThiemeVerlagPlugin") != -1) or | def _is_reported(auid): # If you change this list, be sure to change the equivalent list # in BurpReport.py. return ( ((auid.find("ClockssHighWirePlugin") != -1) and (auid.find("aappublications") != -1)) or ((auid.find("ClockssHighWirePlugin") != -1) and (auid.find("ama-assn") != -1)) or ((auid.find("ClockssHighWireP... |
((auid[0].find("HighWire") != -1) and (auid[0].find("royalsocietypublishing") != 0)) or | ((auid.find("HighWire") != -1) and (auid.find("royalsocietypublishing") != 0)) or | def _is_reported(auid): # If you change this list, be sure to change the equivalent list # in BurpReport.py. return ( ((auid.find("ClockssHighWirePlugin") != -1) and (auid.find("aappublications") != -1)) or ((auid.find("ClockssHighWirePlugin") != -1) and (auid.find("ama-assn") != -1)) or ((auid.find("ClockssHighWireP... |
((auid[0].find("HighWire") != -1) and (auid[0].find("biolreprod%2Eorg") != -1)) | ((auid.find("HighWire") != -1) and (auid.find("biolreprod%2Eorg") != -1)) | def _is_reported(auid): # If you change this list, be sure to change the equivalent list # in BurpReport.py. return ( ((auid.find("ClockssHighWirePlugin") != -1) and (auid.find("aappublications") != -1)) or ((auid.find("ClockssHighWirePlugin") != -1) and (auid.find("ama-assn") != -1)) or ((auid.find("ClockssHighWireP... |
statuses = TdbqPredicate(lambda au: au.status() in [AU.STATUS_RELEASED, AU.STATUS_DOWN, AU.STATUS_SUPERSEDED, AU.STATUS_RETRACTED]) | statuses = TdbqPredicate(lambda au: au.status() in [AU.Status.RELEASED, AU.Status.DOWN, AU.Status.SUPERSEDED, AU.Status.RETRACTED]) | def tdbq_reprocess(tdb, options): '''Reprocesses a Tdb instance according to the query that may be included in the options. Returns the same Tdb instance if there is no query.''' if not (options.testingStatuses or options.productionStatuses or options.query): return tdb query = None if options.query: query = TdbqParse... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.