rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
versionarch = "@".join(version.rsplit(".", 1)) version, arch = versionarch.split("@", 1)[0:2] | version, arch = version.rsplit(".", 1) versionarch = "@".join((version, arch)) | def load(self): |
info = {} info["version"] = version info["name"] = name info["arch"] = arch info["summary"] = summary info["size"] = element[2] info["group"] = element[3] | info = {"summary": summary, "size" : element[2], "group" : element[3]} | def load(self): |
for i in provides: prv = (RPMProvides, i[0], i[2]) | for n, r, v, f in provides: if n == name and v == version: prv = (NPrv, n, versionarch) else: prv = (Prv, n, v) | def load(self): |
for i in requires: req = (RPMRequires, i[0], i[1], i[2]) reqdict[req] = True | for n, r, v, f in requires: if f: reqdict[(PreReq, n, r, v)] = True else: reqdict[(Req, n, r, v)] = True | def load(self): |
for i in conflicts: cnf = (RPMConflicts, i[0], i[1], i[2]) cnfdict[cnf] = True | for n, r, v, f in conflicts: cnfdict[(Cnf, n, r, v)] = True | def load(self): |
upgdict[(RPMObsoletes, name, "<", version)] = True | upgdict[(Obs, name, "<", versionarch)] = True | def load(self): |
for i in obsoletes: upg = (RPMObsoletes, i[0], i[1], i[2]) | for n, r, v, f in obsoletes: upg = (Obs, n, r, v) | def load(self): |
pkg = self.buildPackage((RPMPackage, name, versionarch), | pkg = self.buildPackage((Pkg, name, versionarch), | def load(self): |
vi = v[i] or None | try: vi = v[i] or None except TypeError: vi = None pass | def load(self): CM = self.COMPMAP CF = self.COMPFLAGS Pkg = RPMPackage Prv = RPMProvides NPrv = RPMNameProvides PreReq = RPMPreRequires Req = RPMRequires Obs = RPMObsoletes Cnf = RPMConflicts prog = iface.getProgress(self._cache) for h, offset in self.getHeaders(prog): if h[1106]: # RPMTAG_SOURCEPACKAGE continue arch =... |
self.commitChangeSet(cs) | self.commitChangeSet(cs, confirm=confirm) | def commitChangeSetStepped(self, changeset, caching=OPTIONAL, confirm=True): if confirm and not iface.confirmChangeSet(changeset): return False |
I18NFILES.append((targetpath, filepath)) | I18NFILES.append((targetpath, [filepath])) | def copy_tree(*args, **kwargs): outputs = copy_tree_orig(*args, **kwargs) for i in range(len(outputs)): if outputs[i].endswith("bin/smart.py"): outputs[i] = outputs[i][:-3] return outputs |
"\n".join([" %s: %s" % (url, failed[url]) | "\n".join([u" %s: %s" % (url, failed[url]) | def fetchPackages(self, packages, caching=OPTIONAL, targetdir=None): fetcher = self._fetcher fetcher.reset() fetcher.setCaching(caching) self.reloadMirrors() if targetdir is None: localdir = os.path.join(sysconf.get("data-dir"), "packages/") if not os.path.isdir(localdir): os.makedirs(localdir) fetcher.setLocalDir(loca... |
alternatives = [] failures = [] if earlyAbort: sortUpgrades(prvpkgs) _maxpw = None _pruneweight = self._pruneweight | def _pending(self, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth if traceVerbosity<4: self.trace(1, "_pending(pw=%f, yw=%f)", (self._pruneweight, self._yieldweight)) else: self.trace(4, "_pending(%s, pw=%f, yw=%f)", (pending, self._pruneweight, self._yieldweight)) | |
if (earlyAbort and _maxpw is not None and pw[prvpkg] > _maxpw): self.trace(2, "early abort of PENDING_REMOVE at %s", (prvpkg)) continue try: cs = changeset.copy() lk = locked.copy() task = trans.TaskInstall(self, prvpkg, cs, lk, None, _pruneweight, self._yieldweight) for res in task: yield res; _pruneweight=min(_prunew... | cs = changeset.copy() lk = locked.copy() task = trans.TaskInstall(self, prvpkg, cs, lk, None, _pruneweight, self._yieldweight, csweight, pw[prvpkg], order, "provide using %s" % prvpkg) heappush(taskheap, task) order += 1 | def _pending(self, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth if traceVerbosity<4: self.trace(1, "_pending(pw=%f, yw=%f)", (self._pruneweight, self._yieldweight)) else: self.trace(4, "_pending(%s, pw=%f, yw=%f)", (pending, self._pruneweight, self._yieldweight)) |
if not (earlyAbort and immediateUpdown): cs = changeset.copy() lk = locked.copy() try: | cs = changeset.copy() lk = locked.copy() class TaskEvacuate(trans.Task): def __init__(inself): trans.Task.__init__(inself, self, inself.evacuate(), cs, lk, _pruneweight, self._yieldweight, csweight, 0.0001, order, "evacuate requiring") def evacuate(inself): cs = inself._changeset lk = inself._locked inself.trace(1, "_p... | def _pending(self, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth if traceVerbosity<4: self.trace(1, "_pending(pw=%f, yw=%f)", (self._pruneweight, self._yieldweight)) else: self.trace(4, "_pending(%s, pw=%f, yw=%f)", (pending, self._pruneweight, self._yieldweight)) |
if reqpkg in locked and isinst(reqpkg): | if reqpkg in lk and cs.installed(reqpkg): | def _pending(self, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth if traceVerbosity<4: self.trace(1, "_pending(pw=%f, yw=%f)", (self._pruneweight, self._yieldweight)) else: self.trace(4, "_pending(%s, pw=%f, yw=%f)", (pending, self._pruneweight, self._yieldweight)) |
task = trans.TaskUpdown(self, reqpkg, cs, lk, _pruneweight, self._yieldweight, force=1) for res in task: yield res; pruneweight=min(_pruneweight,self._pruneweight); task.setWeights(_pruneweight, self._yieldweight) | task = trans.TaskUpdown(inself, reqpkg, cs, lk, inself._pruneweight, inself._yieldweight, force=1) for res in task: yield res; task.setWeights(inself._pruneweight, inself._yieldweight) | def _pending(self, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth if traceVerbosity<4: self.trace(1, "_pending(pw=%f, yw=%f)", (self._pruneweight, self._yieldweight)) else: self.trace(4, "_pending(%s, pw=%f, yw=%f)", (pending, self._pruneweight, self._yieldweight)) |
task = trans.TaskRemove(self, reqpkg, cs, lk, None, pruneweight, self._yieldweight) for res in task: yield res; pruneweight=min(_pruneweight,self._pruneweight); task.setWeights(_pruneweight, self._yieldweight) | task = trans.TaskRemove(inself, reqpkg, cs, lk, None, inself._pruneweight, inself._yieldweight) for res in task: yield res; task.setWeights(inself._pruneweight, inself._yieldweight) task = TaskEvacuate() heappush(taskheap, task) while len(taskheap)>0: task = heappop(taskheap) yw = min(self._yieldweight, _pruneweight)... | def _pending(self, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth if traceVerbosity<4: self.trace(1, "_pending(pw=%f, yw=%f)", (self._pruneweight, self._yieldweight)) else: self.trace(4, "_pending(%s, pw=%f, yw=%f)", (pending, self._pruneweight, self._yieldweight)) |
csweight = getweight(cs) self.trace(3, "feasible PENDING_REMOVE remove alternative (csw=%f)", (csweight), cs) alternatives.append((csweight, cs, lk)) if not alternatives: | yield res _pruneweight = min(_pruneweight, self._pruneweight) heappush(taskheap, task) if len(doneheap)==0: | def _pending(self, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth if traceVerbosity<4: self.trace(1, "_pending(pw=%f, yw=%f)", (self._pruneweight, self._yieldweight)) else: self.trace(4, "_pending(%s, pw=%f, yw=%f)", (pending, self._pruneweight, self._yieldweight)) |
self.trace(1, "_fix()") | self.trace(1, "_fix(pw=%f, yw=%f)", (self._pruneweight, self._yieldweight)) | def _fix(self, pkgs, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth pruneweight = self._pruneweight self.trace(1, "_fix()") |
for fn in h[1027]: | fnlst = h[1027] if type(fnlst) != list: fnlst = [fnlst] for fn in fnlst: | def loadFileProvides(self, fndict): file = open(self._filename) h, offset = rpm.readHeaderFromFD(file.fileno()) bfp = self.buildFileProvides while h: for fn in h[1027]: # RPMTAG_OLDFILENAMES fn = fndict.get(fn) if fn and offset in self._offsets: bfp(self._offsets[offset], (RPMProvides, fn, None)) h, offset = rpm.readHe... |
for fn in h[1027]: | fnlst = h[1027] if type(fnlst) != list: fnlst = [fnlst] for fn in fnlst: | def loadFileProvidesHDL(self, fndict): bfp = self.buildFileProvides for offset, h in enumerate(self._hdl): for fn in h[1027]: # RPMTAG_OLDFILENAMES fn = fndict.get(fn) if fn and offset in self._offsets: bfp(self._offsets[offset], (RPMProvides, fn, None)) |
for fn in h[1027]: | fnlst = h[1027] if type(fnlst) != list: fnlst = [fnlst] for fn in fnlst: | def loadFileProvides(self, fndict): ts = getTS() bfp = self.buildFileProvides for i, filename in enumerate(self._filenames): if i not in self._offsets: continue filepath = os.path.join(self._dir, filename) file = open(filepath) try: h = ts.hdrFromFdno(file.fileno()) except rpm.error, e: file.close() iface.error("%s: %s... |
if optweight is not None and optweight > self._pruneweight: self.trace(2, "pruned _install") raise Prune, _("Pruned installation of %s") % (pkg) | if optweight is not None: if optweight > self._pruneweight: self.trace(2, "pruned _install") raise Prune, _("Pruned installation of %s") % (pkg) elif forkSearch and optweight>=self._yieldweight: self. trace(2, "yielding (ow=%f)", optweight) yield optweight | def _install(self, pkg, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth self.trace(1, "_install(%s, pw=%f, yw=%f)", (pkg, self._pruneweight, self._yieldweight)) |
if (self.origin and self.origin[-1] == "/" and self.mirror and self.mirror[-1] != "/"): | if origin and mirror and origin[-1] == "/" and mirror[-1] != "/": | def __init__(self, system, origin, mirror): self._system = system self.origin = origin self.mirror = mirror |
pruneweight = self._pruneweight | def _fix(self, pkgs, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth pruneweight = self._pruneweight self.trace(1, "_fix(pw=%f, yw=%f)", (self._pruneweight, self._yieldweight)) getweight = trans.getPolicy().getWeight isinst = changeset.installed | |
def getSubProgress(self): | def getSubProgress(self, obj): | def getSubProgress(self): if not hasattr(self, "_progress"): self._progress = Progress() return self._progress |
search = [re.compile(fnmatch.translate("\s+".join(x.split()))[:-1], re.I) for x in shlex.split(self._searchentry.get_text())] | search = [] for tok in shlex.split(self._searchentry.get_text()): tok = fnmatch.translate(tok)[:-1].replace(r"\ ", " ") tok = r"\s+".join(tok.split()) search.append(re.compile(tok)) | def refreshPackages(self): if not self._ctrl: return |
if manual or not channel.getManualUpdate(): steps += channel.getFetchSteps() | steps += channel.getFetchSteps() | def updateCache(self, channels=None, caching=ALWAYS): if channels is None: manual = False self.reloadSysConfChannels() channels = self._channels else: manual = True localdir = os.path.join(sysconf.get("data-dir"), "channels/") if not os.path.isdir(localdir): os.makedirs(localdir) self._fetcher.setLocalDir(localdir, man... |
pkgitems = {} | def fetchPackages(self, packages, caching=OPTIONAL, targetdir=None): fetcher = self._fetcher fetcher.reset() fetcher.setCaching(caching) if targetdir is None: localdir = os.path.join(sysconf.get("data-dir"), "packages/") if not os.path.isdir(localdir): os.makedirs(localdir) fetcher.setLocalDir(localdir, mangle=False) e... | |
pkgitems[pkg] = [] for url in urls: pkgitems[pkg].append(fetcher.enqueue(url, md5=info.getMD5(url), sha=info.getSHA(url), size=info.getSize(url), validate=info.validate)) fetcher.run(what="packages") failed = fetcher.getFailedSet() if failed: raise Error, "Failed to download packages:\n" + \ "\n".join([" %s: %s" % (... | if urls: for url in urls: fetcher.enqueue(url, pkg=pkg, md5=info.getMD5(url), sha=info.getSHA(url), size=info.getSize(url), validate=info.validate)) while True: fetcher.run(what="packages") failed = fetcher.getFailedSet() if failed: raise Error, "Failed to download packages:\n" + \ "\n".join([" %s: %s" % (url, fa... | def fetchPackages(self, packages, caching=OPTIONAL, targetdir=None): fetcher = self._fetcher fetcher.reset() fetcher.setCaching(caching) if targetdir is None: localdir = os.path.join(sysconf.get("data-dir"), "packages/") if not os.path.isdir(localdir): os.makedirs(localdir) fetcher.setLocalDir(localdir, mangle=False) e... |
depth += 1 trace(1, depth, "_install(%s)", (pkg)) | def _install(self, pkg, changeset, locked, pending, depth=0): #print "[%03d] _install(%s)" % (depth, pkg) #depth += 1 | |
depth += 1 trace(1, depth, "_remove(%s)", (pkg)) | def _remove(self, pkg, changeset, locked, pending, depth=0): #print "[%03d] _remove(%s)" % (depth, pkg) #depth += 1 | |
depth += 1 trace(1, depth, "_updown(%s, f=%d)", (pkg, force)) | def _updown(self, pkg, changeset, locked, depth=0, force=0): #print "[%03d] _updown(%s)" % (depth, pkg) #depth += 1 | |
depth += 1 if traceVerbosity<4: trace(1, depth, "_pending()", ()) else: trace(4, depth, "_pending(%s)", (pending)) | def _pending(self, changeset, locked, pending, depth=0): #print "[%03d] _pending()" % depth #depth += 1 | |
updown.append(item[1]) | kind, pkg = item trace(1, depth, "_pending.PENDING_UPDOWN (%s)", (pkg) ) updown.append(pkg) | def _pending(self, changeset, locked, pending, depth=0): #print "[%03d] _pending()" % depth #depth += 1 |
depth += 1 trace(2, depth, "_upgrade(%s)", (pkgs)) | def _upgrade(self, pkgs, changeset, locked, pending, depth=0): #print "[%03d] _upgrade()" % depth #depth += 1 | |
else: trace(3,depth,"_upgrade kept %s %s (csw=%f => w=%f)", (op, pkg, csweight, weight)) | def _upgrade(self, pkgs, changeset, locked, pending, depth=0): #print "[%03d] _upgrade()" % depth #depth += 1 | |
depth += 1 trace(1, depth, "_fix()") | def _fix(self, pkgs, changeset, locked, pending, depth=0): #print "[%03d] _fix()" % depth #depth += 1 | |
if report.remove: | if report.removed: | def __lt__(self, other): return cmp(self, other) < 0 |
lst = report.remove.keys() | lst = report.removed.keys() | def __lt__(self, other): return cmp(self, other) < 0 |
if pkg in report.upgraded or pkg in report.downgraded: continue | def __lt__(self, other): return cmp(self, other) < 0 | |
packages[Sorter(_("Remove (%d)") % len(report.remove))] = \ | packages[Sorter(_("Remove (%d)") % len(report.removed))] = \ | def __lt__(self, other): return cmp(self, other) < 0 |
if doneheap[0].getChangesetWeight() >= csweight: | if len(doneheap)==0 or doneheap[0].getChangesetWeight() >= csweight: | def _updown(self, pkg, force): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth pruneweight = self._pruneweight self.trace(1, "_updown(%s, pw=%f, yw=%f, f=%d)", (pkg, pruneweight, self._yieldweight, force)) |
info["summary"] = elem.text | if elem.text: info["summary"] = elem.text | def load(self): METADATA = nstag(NS_COMMON, "metadata") PACKAGE = nstag(NS_COMMON, "package") NAME = nstag(NS_COMMON, "name") ARCH = nstag(NS_COMMON, "arch") VERSION = nstag(NS_COMMON, "version") SUMMARY = nstag(NS_COMMON, "summary") DESCRIPTION = nstag(NS_COMMON, "description") SIZE ... |
info["description"] = elem.text | if elem.text: info["description"] = elem.text | def load(self): METADATA = nstag(NS_COMMON, "metadata") PACKAGE = nstag(NS_COMMON, "package") NAME = nstag(NS_COMMON, "name") ARCH = nstag(NS_COMMON, "arch") VERSION = nstag(NS_COMMON, "version") SUMMARY = nstag(NS_COMMON, "summary") DESCRIPTION = nstag(NS_COMMON, "description") SIZE ... |
info["group"] = elem.text | if elem.text: info["group"] = elem.text | def load(self): METADATA = nstag(NS_COMMON, "metadata") PACKAGE = nstag(NS_COMMON, "package") NAME = nstag(NS_COMMON, "name") ARCH = nstag(NS_COMMON, "arch") VERSION = nstag(NS_COMMON, "version") SUMMARY = nstag(NS_COMMON, "summary") DESCRIPTION = nstag(NS_COMMON, "description") SIZE ... |
help=_("syncrhonize mirrors from the given file/url, " | help=_("synchronize mirrors from the given file/url, " | def parse_options(argv): parser = OptionParser(usage=USAGE, description=DESCRIPTION, examples=EXAMPLES) parser.defaults["add"] = [] parser.defaults["remove"] = [] parser.defaults["remove_all"] = [] parser.defaults["clear_history"] = None parser.add_option("--show", action="store_true", help=_("show current mirrors")) p... |
if dot == -1 or dot < v.rfind("-"): | slash = v.rfind("-") if dot == -1 or slash == -1 or dot < slash: | def splitarch(v): dot = v.rfind(".") if dot == -1 or dot < v.rfind("-"): return v, None return v[:dot], v[dot+1:] |
optweight = None | optweight = trans.getPolicy().getWeight(changeset) | def _install(self, pkg, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth self.trace(1, "_install(%s, pw=%f, yw=%f)", (pkg, self._pruneweight, self._yieldweight)) |
if optweight is None: optweight = trans.getPolicy().getWeight(changeset) | def _install(self, pkg, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth self.trace(1, "_install(%s, pw=%f, yw=%f)", (pkg, self._pruneweight, self._yieldweight)) | |
if optweight is not None: if optweight > self._pruneweight: self.trace(2, "pruned _install") raise Prune, _("Pruned installation of %s") % (pkg) elif forkSearch and optweight>=self._yieldweight: self. trace(2, "yielding (ow=%f)", optweight) yield optweight | if optweight > self._pruneweight: self.trace(2, "pruned _install") raise Prune, _("Pruned installation of %s") % (pkg) elif forkSearch and optweight>=self._yieldweight: self. trace(2, "yielding (ow=%f)", optweight) yield optweight | def _install(self, pkg, pending): trans = self._trans changeset = self._changeset locked = self._locked depth = self._depth self.trace(1, "_install(%s, pw=%f, yw=%f)", (pkg, self._pruneweight, self._yieldweight)) |
shutil.rmtree("testdir") | try: shutil.rmtree("testdir") except: pass | def make(dir, depth, num): os.mkdir(dir) os.chdir(dir) for n in range(num): f = open("file_%d" % n, "wb") global count count += 1 if count >= 10: count = 0 sys.stdout.write(".") sys.stdout.flush() f.write(os.urandom(n * 100000)) f.close() if depth > 0: make("dir_%d" % n, depth-1, num) os.chdir("..") |
return self.get_active_text() | return self.child.get_text() | def get_text(self): if use_combo_box: return self.get_active_text() else: return _entryClass.get_text(self) |
hbox = gtk.HBox() hbox.set_spacing(5) | hbox1 = gtk.HBox() self.match_case = gtk.CheckButton(label=_('Match case')) self.match_case.set_active(bool(OPT_MATCH_CASE.int_value)) hbox1.pack_start(self.match_case,False, False, 5) self.match_words = gtk.CheckButton(label=_('Match whole words')) self.match_words.set_active(bool(OPT_MATCH_WORDS.int_value)) hbox1.p... | def __init__(self, in_path = None): rox.Window.__init__(self) self.set_title(APP_NAME) self.set_default_size(550, 500) self.cancel = False self.running = False self.selected = False self.path = '' self.what = '' self.where = '' toolbar = gtk.Toolbar() toolbar.set_style(gtk.TOOLBAR_ICONS) toolbar.insert_stock(gtk.STOC... |
hbox.pack_end(self.ignore_binary, False, False) self.match_case = gtk.CheckButton(label=_('Match case')) self.match_case.set_active(bool(OPT_MATCH_CASE.int_value)) hbox.pack_end(self.match_case,False, False) | hbox1.pack_start(self.ignore_binary, False, False, 5) hbox2 = gtk.HBox() | def __init__(self, in_path = None): rox.Window.__init__(self) self.set_title(APP_NAME) self.set_default_size(550, 500) self.cancel = False self.running = False self.selected = False self.path = '' self.what = '' self.where = '' toolbar = gtk.Toolbar() toolbar.set_style(gtk.TOOLBAR_ICONS) toolbar.insert_stock(gtk.STOC... |
hbox.pack_end(self.recurse_dirs,False, False) | hbox2.pack_start(self.recurse_dirs,False, False, 5) | def __init__(self, in_path = None): rox.Window.__init__(self) self.set_title(APP_NAME) self.set_default_size(550, 500) self.cancel = False self.running = False self.selected = False self.path = '' self.what = '' self.where = '' toolbar = gtk.Toolbar() toolbar.set_style(gtk.TOOLBAR_ICONS) toolbar.insert_stock(gtk.STOC... |
vbox.pack_start(hbox, False, False) | vbox.pack_start(hbox1, False, False) vbox.pack_start(hbox2, False, False) | def __init__(self, in_path = None): rox.Window.__init__(self) self.set_title(APP_NAME) self.set_default_size(550, 500) self.cancel = False self.running = False self.selected = False self.path = '' self.what = '' self.where = '' toolbar = gtk.Toolbar() toolbar.set_style(gtk.TOOLBAR_ICONS) toolbar.insert_stock(gtk.STOC... |
self.path_entry = path self.what_entry = what self.where_entry = where | def __init__(self, in_path = None): rox.Window.__init__(self) self.set_title(APP_NAME) self.set_default_size(550, 500) self.cancel = False self.running = False self.selected = False self.path = '' self.what = '' self.where = '' toolbar = gtk.Toolbar() toolbar.set_style(gtk.TOOLBAR_ICONS) toolbar.insert_stock(gtk.STOC... | |
if self.match_case.get_active(): cmd = string.replace(cmd, '$C', OPT_MATCH_CASE_ON.value) else: cmd = string.replace(cmd, '$C', OPT_MATCH_CASE_OFF.value) if self.ignore_binary.get_active(): cmd = string.replace(cmd, '$B', OPT_IGNORE_BIN_ON.value) else: cmd = string.replace(cmd, '$B', OPT_IGNORE_BIN_OFF.value) if self... | cmd = string.replace(cmd, '$C', [OPT_MATCH_CASE_OFF.value, OPT_MATCH_CASE_ON.value] [self.match_case.get_active()]) cmd = string.replace(cmd, '$W', [OPT_MATCH_WORDS_OFF.value, OPT_MATCH_WORDS_ON.value] [self.match_words.get_active()]) cmd = string.replace(cmd, '$B', [OPT_IGNORE_BIN_OFF.value, OPT_IGNORE_BIN_ON.value]... | def start_find(self, *args): '''Execute the find command after applying optional paramters''' self.cancel = False self.running = True self.set_sensitives() self.path_entry.append_text(self.path) self.what_entry.append_text(self.what) self.where_entry.append_text(self.where) cmd = OPT_FIND_CMD.value #long options (dep... |
iter = self.store.append(None) | iter = self.store.append() | def get_status(self, thing): '''Parse the ouput of the find command and fill the listbox.''' outfile = thing.fromchild while True: blocker = tasks.InputBlocker(outfile) yield blocker if self.cancel: os.kill(thing.pid, signal.SIGKILL) self.cancel = False return line = outfile.readline() if line: self.set_sensitives() it... |
item = self.liststore.get_iter_first() index = 0 while item: old_item = self.liststore.get_value(item, 0) if old_item == text: return index item = self.liststore.iter_next(item) index += 1 return None | if not text: return try: item = self.liststore.get_iter_first() index = 0 while item: old_item = self.liststore.get_value(item, 0) if old_item == text: return index item = self.liststore.iter_next(item) index += 1 return None except: return None | def find_text(self, text): |
if self.find_text(text) == None: | if not text: return if self.find_text(text) != None: return try: | def append_text(self, text): if self.find_text(text) == None: |
hbox = gtk.HBox() hbox.set_spacing(5) self.ignore_binary = gtk.CheckButton(label=_('Ignore binary files')) self.ignore_binary.set_active(bool(OPT_IGNORE_BIN.int_value)) hbox.pack_end(self.ignore_binary, False, False) self.match_case = gtk.CheckButton(label=_('Match case')) self.match_case.set_active(bool(OPT_MATCH_CA... | def __init__(self, in_path = None): rox.Window.__init__(self) self.set_title(APP_NAME) self.set_default_size(550, 500) self.cancel = False self.running = False self.selected = False self.path = '' self.what = '' self.where = '' toolbar = gtk.Toolbar() toolbar.set_style(gtk.TOOLBAR_ICONS) toolbar.insert_stock(gtk.STOC... | |
what.connect('changed', self.entry_changed, what, 'what') where.connect('changed', self.entry_changed, where, 'where') path.connect('changed', self.entry_changed, path, 'path') | what.connect('changed', self.entry_changed) where.connect('changed', self.entry_changed) path.connect('changed', self.entry_changed) self.connect('key-press-event', self.key_press) | def __init__(self, in_path = None): rox.Window.__init__(self) self.set_title(APP_NAME) self.set_default_size(550, 500) self.cancel = False self.running = False self.selected = False self.path = '' self.what = '' self.where = '' toolbar = gtk.Toolbar() toolbar.set_style(gtk.TOOLBAR_ICONS) toolbar.insert_stock(gtk.STOC... |
def entry_changed(self, button, widget, item): self.__dict__[item] = widget.get_text() | def entry_changed(self, button): self.path = self.path_entry.get_text() self.what = self.what_entry.get_text() self.where = self.where_entry.get_text() | def entry_changed(self, button, widget, item): self.__dict__[item] = widget.get_text() self.set_sensitives() |
def activate(self, view, path, column): | def key_press(self, text, kev): if kev.keyval == gtk.keysyms.Return or kev.keyval == gtk.keysyms.KP_Enter: if len(self.what) and len(self.where) and len(self.path) and not self.running: self.start_find() return 1 return 0 def activate(self, *args): '''Launch Editor for selected file/text''' | def activate(self, view, path, column): def get_type_handler(dir, mime_type): """Lookup the ROX-defined run action for a given mime type.""" path = basedir.load_first_config('MIME-types') handler = os.path.join(path, '%s_%s' % (mime_type.media, mime_type.subtype)) if os.path.exists(handler): return handler else: #fall ... |
results = db.sql('select g._Genotype_key, a._Annot_key, a._Term_key, a.isNot, ' + \ | results = db.sql('select g._Genotype_key, a._Annot_key, a._Term_key, a.isNot, headerTerm = h._Term_key, h.sequenceNum, ' + \ | def genotypes(): db.sql('select distinct g._Genotype_key ' + \ 'into #genotypes ' + \ 'from #strains s, GXD_Genotype g, VOC_Annot a ' + \ 'where s._Strain_key = g._Strain_key ' + \ 'and g._Genotype_key = a._Object_key ' + \ 'and a._AnnotType_key = 1002 ' + \ 'union ' + \ 'select distinct g._Genotype_key ' + \ 'from #s... |
'and a._AnnotType_key = 1002 ', 'auto') | 'and a._AnnotType_key = 1002 ' + \ 'and a._AnnotType_key = h._AnnotType_key ' + \ 'and a._Object_key = h._Object_key', 'auto') | def genotypes(): db.sql('select distinct g._Genotype_key ' + \ 'into #genotypes ' + \ 'from #strains s, GXD_Genotype g, VOC_Annot a ' + \ 'where s._Strain_key = g._Strain_key ' + \ 'and g._Genotype_key = a._Object_key ' + \ 'and a._AnnotType_key = 1002 ' + \ 'union ' + \ 'select distinct g._Genotype_key ' + \ 'from #s... |
strains() genotypes() references() | def references(): # # reference.bcp # fp = open(OUTPUTDIR + 'reference.bcp', 'w') # # references annotated to a Genotype # db.sql('select distinct e._Refs_key, g._Genotype_key, a._Annot_key, e._AnnotEvidence_key, ' + \ 'cdate = convert(char(20), e.creation_date, 100), ' + \ 'mdate = convert(char(20), e.modification... | |
l = string.split(printName, ';') l.reverse() | if len(printName) > 0: l = string.split(printName, ';') l.reverse() string.join(l, '\\,') | def setGOName(self, printName): ''' # requires: # printName: printName of this Structure # effects: sets the GOName for self. # modifies: self.GOName # returns: nothing # exceptions: none ''' # split printName into a list l = string.split(printName, ';') # reverse the list l.reverse() # put it back together later wi... |
printHeader(fp2, 'Genes with Knockouts available through Public Respositories.', publicBLOG) printHeader(fp3, 'Genes with Knockouts that are not yet available through Public Respositories.', nonpublicBLOG) | printHeader(fp2, 'Genes with Knockouts available through Public Repositories.', publicBLOG) printHeader(fp3, 'Genes with Knockouts that are not yet available through Public Repositories.', nonpublicBLOG) | def printHeader(fp, title, blog): fp.write('</pre>\n') fp.write('<H2>%s</H2>' % (title)) fp.write(blog) fp.write('<TABLE BORDER=3 WIDTH=100%>') fp.write('<th align=left valign=top>MGI Gene ID</th>') fp.write('<th align=left valign=top>Gene Symbol</th>') fp.write('<th align=left valign=top>Gene Name</th>') fp.write('<t... |
fp.write(string.ljust('Human Chr', 20)) | fp.write(string.ljust('Human Chr', 15)) | def processSort1(): reportTitle = 'Homology - Human vs. Mouse (Sorted by Human Chromosome)' reportName = REPORTNAME + '1' fp = reportlib.init(reportName, reportTitle, os.environ['REPORTOUTPUTDIR']) fp.write(string.ljust('Human Chr', 20)) fp.write(SPACE) fp.write(string.ljust('Human Symbol', 25)) fp.write(SPACE) fp.w... |
fp.write(string.ljust('Mouse cM Position', 20)) | fp.write(string.ljust(' Mouse cM', 10)) | def processSort1(): reportTitle = 'Homology - Human vs. Mouse (Sorted by Human Chromosome)' reportName = REPORTNAME + '1' fp = reportlib.init(reportName, reportTitle, os.environ['REPORTOUTPUTDIR']) fp.write(string.ljust('Human Chr', 20)) fp.write(SPACE) fp.write(string.ljust('Human Symbol', 25)) fp.write(SPACE) fp.w... |
fp.write(string.ljust('---------', 20)) | fp.write(string.ljust('---------', 15)) | def processSort1(): reportTitle = 'Homology - Human vs. Mouse (Sorted by Human Chromosome)' reportName = REPORTNAME + '1' fp = reportlib.init(reportName, reportTitle, os.environ['REPORTOUTPUTDIR']) fp.write(string.ljust('Human Chr', 20)) fp.write(SPACE) fp.write(string.ljust('Human Symbol', 25)) fp.write(SPACE) fp.w... |
fp.write(string.ljust('-----------------', 20)) | fp.write(string.ljust(' --------', 10)) | def processSort1(): reportTitle = 'Homology - Human vs. Mouse (Sorted by Human Chromosome)' reportName = REPORTNAME + '1' fp = reportlib.init(reportName, reportTitle, os.environ['REPORTOUTPUTDIR']) fp.write(string.ljust('Human Chr', 20)) fp.write(SPACE) fp.write(string.ljust('Human Symbol', 25)) fp.write(SPACE) fp.w... |
fp.write(SPACE) fp.write(string.ljust(r['mouseChr'], 10)) fp.write(SPACE) fp.write(string.ljust(r['mouseCm'], 10)) | def processSort1(): reportTitle = 'Homology - Human vs. Mouse (Sorted by Human Chromosome)' reportName = REPORTNAME + '1' fp = reportlib.init(reportName, reportTitle, os.environ['REPORTOUTPUTDIR']) fp.write(string.ljust('Human Chr', 20)) fp.write(SPACE) fp.write(string.ljust('Human Symbol', 25)) fp.write(SPACE) fp.w... | |
sortKeys = [] sortKeys = [''] * 2 | sortKeys = [''] * 3 | def processSort1(): reportTitle = 'Homology - Human vs. Mouse (Sorted by Human Chromosome)' reportName = REPORTNAME + '1' fp = reportlib.init(reportName, reportTitle, os.environ['REPORTOUTPUTDIR']) fp.write(string.ljust('Human Chr', 15)) fp.write(SPACE) fp.write(string.ljust('Human Symbol', 25)) fp.write(SPACE) fp.w... |
goName = 'TS%d\,' % (self.getStageNum()) else: goName = '< TS%d\,' % (self.getStageNum()) + string.join(l, '\\,') if self.getEBKey() != None: goName = goName + '; EMAP:%s' % (mgi_utils.prvalue(self.getEBKey())) | return goName = '< TS%d\,' % (self.getStageNum()) + string.join(l, '\\,') if self.getEBKey() != None: goName = goName + '; EMAP:%s' % (mgi_utils.prvalue(self.getEBKey())) | def setGOName(self, printName): ''' # requires: # printName: printName of this Structure # effects: sets the GOName for self. # modifies: self.GOName # returns: nothing # exceptions: none ''' |
if snode.getEBKey() != None or snode.getParent() == None: fd.write('%s%s\n' % (depth * indent , name)) | if snode.getEBKey() != None: fd.write('%s%s\n' % (depth * indent , name)) | def print_structure_tree(snode, fd, indent): ''' # requires: # snode: Structure node # fd: the output file descriptor # indent (string) characters used to indent nodes at greater depth # effects: recursively prints a text rep of the node snode, and its descendants # modifies: nothing # returns: nothing # exceptio... |
db.sql('select m._Marker_key into | db.sql('select distinct m._Marker_key into | def initialize(): global fpA, fpB global rep, seqs, markers, mgiIDs fpA = reportlib.init(reportNameA, outputdir = os.environ['INPARANOIDDIR'], printHeading = None, fileExt = fileExtension) fpB = reportlib.init(reportNameB, outputdir = os.environ['INPARANOIDDIR'], printHeading = None, fileExt = fileExtension) # delet... |
seqs[key] = value | if not seqs.has_key(key): seqs[key] = [] seqs[key].append(value) | def initialize(): global fpA, fpB global rep, seqs, markers, mgiIDs fpA = reportlib.init(reportNameA, outputdir = os.environ['INPARANOIDDIR'], printHeading = None, fileExt = fileExtension) fpB = reportlib.init(reportNameB, outputdir = os.environ['INPARANOIDDIR'], printHeading = None, fileExt = fileExtension) # delet... |
markerKey = seqs[seqID] symbol = markers[markerKey] mgiID = mgiIDs[markerKey] newLine = header % (mgiID, mgi_utils.date('%m/%d/%Y'), symbol, seqID) if rep.has_key(seqID): fpA.write(newLine) fpB.write(newLine) | for markerKey in seqs[seqID]: symbol = markers[markerKey] mgiID = mgiIDs[markerKey] newLine = header % (mgiID, mgi_utils.date('%m/%d/%Y'), symbol, seqID) if rep.has_key(seqID): fpA.write(newLine) fpB.write(newLine) | def process(inFileName, column, header): inFile = open(inFileName, 'r') skipRecord = 0 for line in inFile.readlines(): # a header line is one the starts with ">" if line[0] == '>': skipRecord = 0 tokens1 = string.split(line[:-1], '|') tokens2 = string.split(tokens1[column], '.') seqID = tokens2[0] # if the seq ID... |
results = db.sql('select distinct m._Marker_key, m.label, m.labelType, status = 1 ' + \ | results = db.sql('select distinct m._Marker_key, m.label, m.labelType, status = 1, ' + \ 'cdate = convert(char(20), getdate(), 100) ' + \ | def markers(): # # marker # marker_label # accession_marker # # # select all mouse markers which have a preferred MGI Accession ID. # this will include any splits (since the MGI Acc ID stays with # the split symbol). # db.sql('select m._Marker_key, m._Organism_key, m.symbol, m.name ' + \ 'into #markers ' + \ 'from M... |
currentDate + TAB + \ currentDate + CRT) results = db.sql('select distinct m._Marker_key, m.label, m.labelType, status = 1 ' + \ | r['cdate'] + TAB + \ r['cdate'] + CRT) results = db.sql('select distinct m._Marker_key, m.label, m.labelType, status = 1, ' + \ 'cdate = convert(char(20), getdate(), 100) ' + \ | def markers(): # # marker # marker_label # accession_marker # # # select all mouse markers which have a preferred MGI Accession ID. # this will include any splits (since the MGI Acc ID stays with # the split symbol). # db.sql('select m._Marker_key, m._Organism_key, m.symbol, m.name ' + \ 'into #markers ' + \ 'from M... |
currentDate + TAB + \ currentDate + CRT) results = db.sql('select distinct m._Marker_key, m.label, m.labelType, status = 0 ' + \ | r['cdate'] + TAB + \ r['cdate'] + CRT) results = db.sql('select distinct m._Marker_key, m.label, m.labelType, status = 0, ' + \ 'cdate = convert(char(20), getdate(), 100) ' + \ | def markers(): # # marker # marker_label # accession_marker # # # select all mouse markers which have a preferred MGI Accession ID. # this will include any splits (since the MGI Acc ID stays with # the split symbol). # db.sql('select m._Marker_key, m._Organism_key, m.symbol, m.name ' + \ 'into #markers ' + \ 'from M... |
currentDate + TAB + \ currentDate + CRT) | r['cdate'] + TAB + \ r['cdate'] + CRT) | def markers(): # # marker # marker_label # accession_marker # # # select all mouse markers which have a preferred MGI Accession ID. # this will include any splits (since the MGI Acc ID stays with # the split symbol). # db.sql('select m._Marker_key, m._Organism_key, m.symbol, m.name ' + \ 'into #markers ' + \ 'from M... |
value = r['note'] | value = string.strip(r['note']) | def writeRecord(r, refID): # if we can't find the DAG for the Term, skip it if not dag.has_key(r['_Term_key']): return fp.write(DBABBREV + TAB) fp.write(r['markerID'] + TAB) fp.write(r['symbol'] + TAB) if r['isNot'] == 1: fp.write('NOT') fp.write(TAB) fp.write(r['termID'] + TAB) fp.write(refID + TAB) fp.write(r['e... |
value = string.join(allnotes[n]) | value = string.join(allnotes[n], '') | def writeRecord(r, refID): # if we can't find the DAG for the Term, skip it if not dag.has_key(r['_Term_key']): return fp.write(DBABBREV + TAB) fp.write(r['markerID'] + TAB) fp.write(r['symbol'] + TAB) if r['isNot'] == 1: fp.write('NOT') fp.write(TAB) fp.write(r['termID'] + TAB) fp.write(refID + TAB) fp.write(r['e... |
'and a._Object_key = 605 ' + \ | def writeRecord(r, refID): # if we can't find the DAG for the Term, skip it if not dag.has_key(r['_Term_key']): return fp.write(DBABBREV + TAB) fp.write(r['markerID'] + TAB) fp.write(r['symbol'] + TAB) if r['isNot'] == 1: fp.write('NOT') fp.write(TAB) fp.write(r['termID'] + TAB) fp.write(refID + TAB) fp.write(r['e... | |
'and m._Marker_Type_key = 1', None) db.sql('create index idx1 on db.sql('select accID, _Marker_key, _Qualifier_key into db.sql('create index idx1 on | 'and m._Marker_Type_key = 1 '+ \ 'and not exists (select 1 from 's._Marker_key = x._Marker_key)', None) db.sql('create index idx1 on db.sql('create index idx2 on | def initialize(): global fpA, fpB global rep, seqs, markers, mgiIDs fpA = reportlib.init(reportNameA, outputdir = os.environ['INPARANOIDDIR'], printHeading = None, fileExt = fileExtension) fpB = reportlib.init(reportNameB, outputdir = os.environ['INPARANOIDDIR'], printHeading = None, fileExt = fileExtension) # # sel... |
skipRecord = 0 | def process(inFileName, column, header): inFile = open(inFileName, 'r') skipRecord = 0 for line in inFile.readlines(): # a header line is one the starts with ">" if line[0] == '>': tokens1 = string.split(line[:-1], '|') tokens2 = string.split(tokens1[column], '.') seqID = tokens2[0] # if the seq ID in the FASTA fi... | |
calendar.week['firstDay'] = 7 | calendar.week = {'firstDay': 7, 'minDays': 1} | def testFormatWeekDay(self): date = datetime.date(2003, 01, 02) self.assertEqual(self.format.format(date, "E"), '4') self.assertEqual(self.format.format(date, "EE"), '04') self.assertEqual(self.format.format(date, "EEE"), 'Do') self.assertEqual(self.format.format(date, "EEEE"), 'Donnerstag') |
def test_suite(): return unittest.TestSuite(( doctest.DocFileSuite('../testmessagecatalog.txt'), )) | from zope import interface from zope.i18n.interfaces import IGlobalMessageCatalog | def test_suite(): return unittest.TestSuite(( doctest.DocFileSuite('../testmessagecatalog.txt'), )) |
if __name__ == '__main__': unittest.main(defaultTest='test_suite') | class TestMessageCatalog: interface.implements(IGlobalMessageCatalog) | def test_suite(): return unittest.TestSuite(( doctest.DocFileSuite('../testmessagecatalog.txt'), )) |
raise DateTimeParseError, \ 'The datetime string did not match the pattern.' | raise DateTimeParseError( 'The datetime string did not match the pattern.') | def parse(self, text, pattern=None, asObject=True): "See zope.i18n.interfaces.IFormat" # Make or get binary form of datetime pattern if pattern is not None: bin_pattern = parseDateTimePattern(pattern) else: bin_pattern = self._bin_pattern # Generate the correct regular expression to parse the date and parse. regex = ''... |
if asObject == False: | if not asObject: | def parse(self, text, pattern=None, asObject=True): "See zope.i18n.interfaces.IFormat" # Make or get binary form of datetime pattern if pattern is not None: bin_pattern = parseDateTimePattern(pattern) else: bin_pattern = self._bin_pattern # Generate the correct regular expression to parse the date and parse. regex = ''... |
self._catalog = GNUTranslations(fp, coerce=True) | self._catalog = GNUTranslations(fp) | def __init__(self, language, domain, path_to_file): """Initialize the message catalog""" self._language = language self._domain = domain self._path_to_file = path_to_file fp = open(self._path_to_file, 'r') try: self._catalog = GNUTranslations(fp, coerce=True) finally: fp.close() self._catalog.add_fallback(_KeyErrorRais... |
fp = open(self._path_to_file, 'r') | fp = open(self._path_to_file, 'rb') | def reload(self): 'See IMessageCatalog' fp = open(self._path_to_file, 'r') try: self._catalog = GNUTranslations(fp) finally: fp.close() |
unittest.main(defaultTest='test_suite') | main(defaultTest='test_suite') | def test_suite(): return TestSuite(( makeSuite(TestLocaleProvider), makeSuite(TestLocaleAndProvider), makeSuite(TestGlobalLocaleProvider), makeSuite(TestRootLocale), )) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.