rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
start_render(rndr, rib, item, rhandle, scene) | start_render(rndr, rib, item, scene) | def render(rhandle, scene): rndr = scene.renderman_settings.renderexec if rndr != "": maintain(scene) path = getdefaultribpath(scene) active_pass = getactivepass(scene) |
export(active_pass, path, rhandle, scene) | export(active_pass, path, scene) | def render(rhandle, scene): rndr = scene.renderman_settings.renderexec if rndr != "": maintain(scene) path = getdefaultribpath(scene) active_pass = getactivepass(scene) |
start_render(rndr, rib, active_pass, rhandle, scene) | start_render(rndr, rib, active_pass, scene) | def render(rhandle, scene): rndr = scene.renderman_settings.renderexec if rndr != "": maintain(scene) path = getdefaultribpath(scene) active_pass = getactivepass(scene) |
class Renderman_PT_Render(RenderButtonsPanel, bpy.types.Panel): bl_label = "Render" COMPAT_ENGINES = {'RENDERMAN'} def draw(self, context): layout = self.layout row = layout.row() row.operator("renderman.render", text="Image", icon="RENDER_STILL") row.operator("renderman.render", text="Animation", icon="RENDER_ANIMAT... | def poll(cls, context): rd = context.scene.render return (context.scene and rd.use_game_engine is False) and (rd.engine in cls.COMPAT_ENGINES) | |
if obj.type == 'MESH': | def writeChildren(): for child in obj.children: if child.name not in exported_children: writeObject(path, child, current_pass, write, scene) exported_children.append(child.name) if obj.type == 'EMPTY': if obj.children: writeChildren() elif obj.type in ['MESH']: | def writeObject(path, obj, current_pass, write, scene): if obj.type == 'MESH': if check_visible(obj, scene): print("write "+obj.name) mat = obj.active_material write("\nAttributeBegin\n") write('Attribute "identifier" "name" ["'+obj.name+'"]\n') write_attrs_or_opts(obj.renderman[current_pass.name].attribute_groups, w... |
for child in obj.children: if child.name not in exported_children: writeObject(scene, path, child, current_pass, write) exported_children.append(child.name) | writeChildren() | def writeObject(path, obj, current_pass, write, scene): if obj.type == 'MESH': if check_visible(obj, scene): print("write "+obj.name) mat = obj.active_material write("\nAttributeBegin\n") write('Attribute "identifier" "name" ["'+obj.name+'"]\n') write_attrs_or_opts(obj.renderman[current_pass.name].attribute_groups, w... |
<pre><script type="<a href="script">http://fw.mearie.org/script</a>"></script></pre> | <pre><script src="<a href="script">http://fw.mearie.org/script</a>"></script></pre> | def GET(self): web.header('Content-type', 'text/html') return '''\ |
if not self.showCurrWdg.getBool(): return "image Hold mode" | def whyNotCenter(self, evt=None): """Is it possible to center up on a position in the current image? Return None if one can center, or a reason why not if not """ if not self.guideModel.gcamInfo.isSlitViewer: return "not a slitviewer" | |
self.centerBtn.setEnable(showCurrIm and isCurrIm and isSel and not isExecOrGuiding) | reasonStr = self.whyNotCenter() self.centerBtn.setEnable(showCurrIm and isCurrIm and isSel and not isExecOrGuiding and not reasonStr) | def enableCmdButtons(self, wdg=None): """Set enable of command buttons. """ showCurrIm = self.showCurrWdg.getBool() isImage = self.imDisplayed() isCurrIm = isImage and not self.nextImWdg.getEnable() isSel = (self.dispImObj != None) and (self.dispImObj.selDataColor != None) isGuiding = self.isGuiding() isExec = (self.do... |
self.stripChartWdg.subplotArr[2].yaxis.set_label_text("Focus um") | self.stripChartWdg.subplotArr[2].yaxis.set_label_text("Focus (um)") | def __init__(self, master, timeRange=7200, width=9, height=4): """Create a SeeingMonitorWdg Inputs: - master: parent Tk widget - timeRange: range of time displayed (seconds) - width: width of plot (inches) - hiehgt: height of plot (inches) """ Tkinter.Frame.__init__(self, master) tccModel = TUI.TCC.TCCModel.getModel(... |
fdno = os.open(filename, os.O_RDONLY) | self._fdno = os.open(filename, os.O_RDONLY) | def archive(self): """ Open an load rpm file and return the enclosed CpioArchive object. The requestor is responsible for closing the archive. """ |
rpm2cpio(fdno, out=cpio) | rpm2cpio(self._fdno, out=cpio) | def archive(self): """ Open an load rpm file and return the enclosed CpioArchive object. The requestor is responsible for closing the archive. """ |
return re.compile(r"^.*/(icons|pixmaps).*/(%s)\.png$" % '|'.join(icon_names)) | return re.compile(r"^.*/(icons|pixmaps).*/(%s)\.png$" % '|'.join((re.escape(e) for e in icon_names))) | def re_custom_icons(self, icon_names=()): return re.compile(r"^.*/(icons|pixmaps).*/(%s)\.png$" % '|'.join(icon_names)) |
url = '/packages/orphans' | url = '/acls/orphans' | def packages(self, fasname=None, acls=None, eol=None): '''List packages that the user is interested in. |
self.yumbase = yum.YumBase() cachedir = getCacheDir(cachedir) if not cachedir: | self._yumbase = None self.cachedir = getCacheDir(cachedir) if not self.cachedir: | def __init__(self, repo, cachedir='/var/tmp', force=False): self.repo = repo self.force = force self.collection = repo.collection self._yumrepo = None self.yumbase = yum.YumBase() cachedir = getCacheDir(cachedir) if not cachedir: raise PkgImportError('Unable to setup yum cache directory.') |
self.yumbase.repos.setCacheDir(cachedir + varReplace('/$basearch/$releasever', self.yumbase.yumvar)) self.yumbase.conf.cachedir = cachedir self.yumbase.doTsSetup() | def __init__(self, repo, cachedir='/var/tmp', force=False): self.repo = repo self.force = force self.collection = repo.collection self._yumrepo = None self.yumbase = yum.YumBase() cachedir = getCacheDir(cachedir) if not cachedir: raise PkgImportError('Unable to setup yum cache directory.') | |
self.prune_builds() | if prune: self.prune_builds() if self._yumbase: self._yumbase.cleanPackages() self._yumbase.cleanExpireCache() self._yumbase.close() | def close(self, prune=True): self.prune_builds() |
This method change the owner of the package. | This method changes the owner of the package. | def set_owner(self, pkg_name, owner=None, collectn_list=None): '''Change owner of a package. |
If owner='orphan' owner will be set to 'orphan'. | If owner='orphan' owner will be set to 'orphan' and the package status set to Orphaned | def set_owner(self, pkg_name, owner=None, collectn_list=None): '''Change owner of a package. |
approved = self._user_can_set_acls(identity, pkg) if not approved or approved not in ('admin', 'owner'): return dict(status=False, message= _('%(user)s is not allowed to approve Package ACLs') % { 'user': identity.current.user_name}) | def set_owner(self, pkg_name, owner=None, collectn_list=None): '''Change owner of a package. | |
'''Retrieve all tags belonging to one or more PackageBuilds. | '''Retrieve all tags belonging to one or more Applications. | def packages(self, apps): '''Retrieve all tags belonging to one or more PackageBuilds. |
:arg apps: The name (or list of names) of a generic PackageBuild | :arg apps: The name (or list of names) of an application | def packages(self, apps): '''Retrieve all tags belonging to one or more PackageBuilds. |
self.baseurl = config.get('base_url_filter.base_url') | baseurl = config.get('base_url_filter.base_url') while baseurl.endswith('/'): baseurl = baseurl[:-1] baseurl = '%s%s' % (baseurl, tg_url('/')) if baseurl.endswith('/'): baseurl = baseurl[:-1] self.baseurl = baseurl | def __init__(self): self.baseurl = config.get('base_url_filter.base_url') |
entry["link"] = self.baseurl + '/packages/%s/%s' % ( | entry["link"] = '%s/packages/%s/%s' % (self.baseurl, | def get_feed_data(self, **kwargs): entries = [] # look for repoid try: repoid = int(kwargs.get('repoid', 1)) except: repoid = 1 # how many items to output try: items = int(kwargs.get('items', 20)) except: items = 20 # TODO apps |
entry["link"] = self.baseurl + '/applications/%s/ | entry["link"] = '%s/applications/%s/ | def get_feed_data(self, **kwargs): entries = [] |
@paginate('build_list', limit=50, default_order='name', max_limit=None, | @paginate('build_list', limit=90, default_order=('-score','name'), max_limit=None, | def default(self): '''Builds Home Page ''' |
build_list = sorted(build_base.values(), key=itemgetter('score'), reverse=True) | def search(self, *pattern): '''Builds search result | |
pattern=pattern, s_pattern=s_pattern, build_list=build_list) | pattern=pattern, s_pattern=s_pattern, build_list=build_base.values()) | def search(self, *pattern): '''Builds search result |
'usage': [] | 'usage': [], 'iconname': app['iconname'], 'mstatus': app['mstatus'] | def search(self, pattern=u''): '''Applications search result |
packages = select((Package), and_(Package.id==PackageListing.packageid, | packages = select((PackageTable,), and_(Package.id==PackageListing.packageid, | def name(self, collctn): '''Return a page with information on a particular Collection |
Package.stauscode!=STATUS['Removed'].statuscodeid), order_by=(Package.name,)) | Package.statuscode!=STATUS['Removed'].statuscodeid), order_by=(Package.name,)).execute() | def name(self, collctn): '''Return a page with information on a particular Collection |
return dict(title='%s -- %s %s' % (self.app_title, collection['name'], collection['version']), collection=collection_entry, | return dict(title='%s -- %s %s' % (self.app_title, collection.name, collection.version), collection=collection_entry, | def name(self, collctn): '''Return a page with information on a particular Collection |
if isinstance(self.build, yum.packages.YumLocalPackage): filename = self.build.localPkg() else: | filename = self.build.localPkg() if not os.path.exists(filename): | def archive(self): """ Open an load rpm file and return the enclosed CpioArchive object. The requestor is responsible for closing the archive. """ |
rpm2cpio(self._fdno, out=cpio) | try: rpm2cpio(self._fdno, out=cpio) except Exception, e: raise PkgImportError("Invalid RPM file (%s). Yum cache broken?" % e) | def archive(self): """ Open an load rpm file and return the enclosed CpioArchive object. The requestor is responsible for closing the archive. """ |
@validate(validators=AclName()) @error_handler() | def __init__(self, app_title=None): '''Create an Aclsn Controller. | |
owner_query = owner_query.where(Collection.statuscode.in_( | owner_query = owner_query.where(CollectionTable.c.statuscode.in_( | def notify(self, name=None, version=None, eol=False): '''List of usernames that should be notified of changes to a package. |
watcher_query = watcher_query.where(Collection.statuscode.in_( | watcher_query = watcher_query.where(CollectionTable.c.statuscode.in_( | def notify(self, name=None, version=None, eol=False): '''List of usernames that should be notified of changes to a package. |
pkgbuild.repos.append(self.repos) | pkgbuild.repos.append(self.repo) | def store_package_build(self, rpm): """Store packagebuild data in DB |
categories = [] | categories = set() | def from_file(self, data): """initialize Desktop object with data from .desktop file :arg data: open .desktop file :raises DesktopParseError: on invalid file :returns: initialized Desktop object """ try: conf = ConfigParser() conf.readfp(data) except Exception, e: raise DesktopParseError('Failed to read .desktop file (... |
categories.append(c) | categories.add(c) | def from_file(self, data): """initialize Desktop object with data from .desktop file :arg data: open .desktop file :raises DesktopParseError: on invalid file :returns: initialized Desktop object """ try: conf = ConfigParser() conf.readfp(data) except Exception, e: raise DesktopParseError('Failed to read .desktop file (... |
mimetypes = [] | mimetypes = set() | def from_file(self, data): """initialize Desktop object with data from .desktop file :arg data: open .desktop file :raises DesktopParseError: on invalid file :returns: initialized Desktop object """ try: conf = ConfigParser() conf.readfp(data) except Exception, e: raise DesktopParseError('Failed to read .desktop file (... |
mimetypes.append(mt) | mimetypes.add(mt) | def from_file(self, data): """initialize Desktop object with data from .desktop file :arg data: open .desktop file :raises DesktopParseError: on invalid file :returns: initialized Desktop object """ try: conf = ConfigParser() conf.readfp(data) except Exception, e: raise DesktopParseError('Failed to read .desktop file (... |
return dict(status=True, retirement=retirement, aclStatusFields=self.acl_status_translations) | return dict(status=True, retirement=retirement) | def toggle_retirement(self, pkg_listing_id): '''Retire/Unretire package |
return "%s-%s%s-%s.%s" % (self.name, ('', self.epoch+':')[bool(int(self.epoch))], self.version, | return "%s-%s-%s.%s" % (self.name, self.version, | def __str__(self): return "%s-%s%s-%s.%s" % (self.name, ('', self.epoch+':')[bool(int(self.epoch))], self.version, self.release, self.architecture) |
def download_path(self): return "%s%s%s%s.rpm" % (self.repo.mirror, self.repo.url, ('','Packages/')[self.repo.url.endswith('os/')], self) | def download_path(self, reponame=None): """Find download path of the build :args reponame: prefered repo from where the build should be downloaded :returns: URI of the build Find download URI of the build. If build is available in <reponame> repo, path to that repo is used. Path to first available repo is returned ot... | def download_path(self): return "%s%s%s%s.rpm" % (self.repo.mirror, self.repo.url, ('','Packages/')[self.repo.url.endswith('os/')], self) |
collection = collection.filter(statuscode!=STATUS['EOL']) | collection = collection.filter(Collection.statuscode!=STATUS['EOL']) | def name(self, packageName, collectionName=None, collectionVersion=None, eol=False): '''Retrieve Packages by their name. |
@expose(template='pkgdb.templates.apps') | @expose(template='pkgdb.templates.home') | def logout(self): return f_ctrlers.logout() |
redirect('/apps/name/list/a*') | comments = Application.last_commented(10) popular = Application.most_popular(limit=10) return dict(title=self.app_title, version=release.VERSION, pattern='', comments=comments, fresh=fresh, popular=popular) | def index(self): '''Overview of the PackageDB. |
self._set_owner(pkg.package.name, person) | self._set_owner(pkg, person) | def toggle_retirement(self, pkg_listing_id): '''Retire/Unretire package |
out_file.write('0 \n', inlinetime) | out_file.write('0 %d\n' % inlinetime) | def _entry(self, entry): out_file = self.out_file |
sql_log.setLevel(logging.INFO) | def profileit(self, func, *args, **kvargs): """Wraps method in cprofiler call and collects data | |
logging.getLogger('sqlalchemy.engine.base.Engine').addHandler(sql_log) | sql_log.setLevel(logging.INFO) sa_logger = logging.getLogger('sqlalchemy.engine') sa_logger.addHandler(sql_log) | def profileit(self, func, *args, **kvargs): """Wraps method in cprofiler call and collects data |
logging.getLogger('sqlalchemy.engine.base.Engine').removeHandler(sql_log) | sa_logger.removeHandler(sql_log) | def profileit(self, func, *args, **kvargs): """Wraps method in cprofiler call and collects data |
self.name = to_unicode(name) self.generic_name = to_unicode(generic_name) self.comment = to_unicode(comment) self.target_type = to_unicode(target_type) self.icon_name = to_unicode(icon_name) self.categories = to_unicode(categories) self.mimetypes = to_unicode(mimetypes) | self.name = name self.generic_name = generic_name self.comment = comment self.target_type = target_type self.icon_name = icon_name self.categories = categories self.mimetypes = mimetypes | def __init__(self, name, generic_name=None, comment=None, target_type='Application', icon_name=None, categories=[], mimetypes=[]): self.name = to_unicode(name) self.generic_name = to_unicode(generic_name) self.comment = to_unicode(comment) self.target_type = to_unicode(target_type) self.icon_name = to_unicode(icon_name... |
@validate(validators = {'collctn_list': SetOf(element_validator=IsCollectionSimpleNameRegex())}) | @validate(validators = {'collctn_list': SetOf(use_set=True, element_validator=IsCollectionSimpleNameRegex())}) | def notify(self, name=None, version=None, eol=False): '''List of usernames that should be notified of changes to a package. |
CollectionTable.c.id==BranchTable.c.collectionid)) | CollectionTable.c.id==BranchTable.c.collectionid, PackageListingTable.c.critpath==True)) | def critpath(self, collctn_list=None): '''Retrieve the list of packages that are critpath |
pkgs[pkg[0]] = set(pkg[1]) | pkgs[pkg[0]] = set() pkgs[pkg[0]].add(pkg[1]) | def critpath(self, collctn_list=None): '''Retrieve the list of packages that are critpath |
Repo.shortname=='F-11-i386'))) | Repo.shortname=='F-11-i386'))).distinct() | def sqlitebuildtags(self, repo): '''Return a sqlite database of packagebuilds and tags. |
pkg_tags.append({'name': tag[0], 'tag': tag[1], 'score': tag[2]}) | if (tag[0], tag[1]) not in used_tags: pkg_tags.append({'name': tag[0], 'tag': tag[1], 'score': tag[2]}) used_tags.add((tag[0], tag[1])) | def sqlitebuildtags(self, repo): '''Return a sqlite database of packagebuilds and tags. |
collectionMapper = mapper(Collection, CollectionTable, polymorphic_on=collectionJoin.c.kind, polymorphic_identity='collection', with_polymorphic=('*',collectionJoin), | mapper(Collection, CollectionJoin, polymorphic_on=CollectionJoin.c.kind, polymorphic_identity='c', with_polymorphic='*', | def __repr__(self): # pylint: disable-msg=E1101 return 'CollectionPackage(id=%r, name=%r, version=%r,' \ ' statuscode=%r, numpkgs=%r,' % ( self.id, self.name, self.version, self.statuscode, self.numpkgs) |
mapper(Branch, BranchTable, inherits=collectionMapper, inherit_condition=CollectionTable.c.id==BranchTable.c.collectionid, | mapper(Branch, BranchTable, inherits=Collection, inherit_condition=CollectionJoin.c.id==BranchTable.c.collectionid, | def __repr__(self): # pylint: disable-msg=E1101 return 'CollectionPackage(id=%r, name=%r, version=%r,' \ ' statuscode=%r, numpkgs=%r,' % ( self.id, self.name, self.version, self.statuscode, self.numpkgs) |
if request_format() == 'json': packages = list(packages) | def name(self, collctn): '''Return a page with information on a particular Collection | |
raise | def yumrepo(self): if not self._yumrepo: self.yumbase.repos.disableRepo('*') self.yumbase.add_enable_repo('pkgdb-%s' % self.repo.shortname, ['%s%s' % (self.repo.mirror, self.repo.url)]) self._yumrepo = self.yumbase.repos.getRepo('pkgdb-%s' % self.repo.shortname) # populate sack try: self.yumbase._getSacks(thisrepo=sel... | |
print c | def update(self): keys = self.ComponentsToUpdate.keys() keys.sort() for target in keys: while not self.ComponentsToUpdate[target].empty(): c = self.ComponentsToUpdate[target].get() print c c.update() | |
REPOS[url] = dict() | def process_svn(root): global LAST_URL global LAST_PATH os.chdir(root) root = re.sub(os.path.dirname(BASE_DIR)+os.sep, '', root) pipe = os.popen("svn info") for line in pipe: if re.match('URL:', line): url = re.sub('URL: ', '', line.strip()) # first check for recursive occurences of .svn, etc if not re.search(LAST_URL,... | |
REPOS[url]['target'] = target REPOS[url]['type'] = 'svn' REPOS[url]['url'] = url REPOS[url]['checkout'] = checkout LAST_URL = url | target = re.sub(os.sep+'$', '', target) target = re.sub(r'^%s' % ROOT, r'$ROOT', target) if checkout == '': checkout = '.' for i in range(len(path)): url = re.sub(path[i], r'$%d' % (i+1), url, count=1) try: REPOS[url]['checkout'].append(checkout) except KeyError: REPOS[url] = {'target' : target, 'type' : 'svn', 'u... | def process_svn(root): global LAST_URL global LAST_PATH os.chdir(root) root = re.sub(os.path.dirname(BASE_DIR)+os.sep, '', root) pipe = os.popen("svn info") for line in pipe: if re.match('URL:', line): url = re.sub('URL: ', '', line.strip()) # first check for recursive occurences of .svn, etc if not re.search(LAST_URL,... |
print "!CHECKOUT= %s" % REPOS[repo]['checkout'] | print "!CHECKOUT= " for c in REPOS[repo]['checkout']: print c | def print_CRL(): """Takes the discovered repositories and outputs formatted CRL.""" print "!CRL_VERSION = 1.0" print "" print "!DEFINE ROOT = %s" % ROOT for repo in REPOS: print "!TARGET = %s" % REPOS[repo]['target'] print "!TYPE = %s" % REPOS[repo]['type'] print "!URL = %s" % REPOS[repo]['url'] print "!CHECKOU... |
os.chdir(BASE_DIR): | os.chdir(BASE_DIR) | def process_git(root): ''' Takes a known git repository and determines the options to clone it. ''' os.chdir(root) print "found git" root = re.sub("%s%s" % (os.path.dirname(BASE_DIR), os.sep), '', root) pipe = os.popen("git remote show -n origin") for line in pipe: if re.search(r'fetch\s+url:', line, flags=re.I): url =... |
if not re.search(LAST_URL, url): LAST_URL = url path = root.split(os.sep) checkout = '' while path != []: if re.search(os.sep.join(path), url): checkout = os.sep.join(path) break else: del path[0] target = re.sub(checkout, '', root) target = re.sub(os.sep+'$', '', target) target = re.sub(r'^%s' % ROOT, r'$ROOT', t... | f = open(os.path.join('CVS', 'Repository')) checkout = f.read().strip() f.close() if url == LAST_URL and re.search(LAST_PATH, checkout): return path = root.split(os.sep) checkout_path, checkout_item = os.path.split(checkout) while path != []: if checkout_item in path: path.remove(checkout_item) checkout_path, checko... | def process_cvs(root): ''' Takes a known CVS repository and determines the options to check it out. ''' global LAST_URL os.chdir(root) root = re.sub("%s%s" % (os.path.dirname(BASE_DIR), os.sep), '', root) f = open(os.path.join('CVS', 'Root')) url = f.read().strip() f.close() # first check for recursive occurrences of C... |
lines = self.getfile("/etc/environment") lang = "en_US" for l in lines: lx = l.split("=") if lx[0] == "LANG": lang = lx[1].strip('"\n') return lang | try: lang = os.environ["LANG"] except KeyError: lang = "en_US" return lang | def oslang(self): #cat /etc/environment lines = self.getfile("/etc/environment") lang = "en_US" for l in lines: lx = l.split("=") if lx[0] == "LANG": lang = lx[1].strip('"\n') return lang |
elif output == "x86": | elif re.match(r'i686|i386', output): | def machinearch(self): output = os.uname()[4] if output == "x86_64": mtype = "64-bit" elif output == "x86": mtype = "32-bit" else: mtype = "x-bit" return mtype |
print( u'Προδιαγραφές ⇛ %s │ RAM %s MiB │ %s│ Μητρική: %s' % | print( u'Προδιαγραφές ⇛ %s │ RAM %s MiB │ %s│ Μητρική: %s (%s)' % | def specs(self): print( u'Προδιαγραφές ⇛ %s │ RAM %s MiB │ %s│ Μητρική: %s' % (self.lshwinfo["cpu"], self.lshwinfo["memory"], self.lshwinfo["display"], self.lshwinfo["system"]) ) |
self.lshwinfo["system"]) | self.lshwinfo["system"], self.lshwinfo["core"] ) | def specs(self): print( u'Προδιαγραφές ⇛ %s │ RAM %s MiB │ %s│ Μητρική: %s' % (self.lshwinfo["cpu"], self.lshwinfo["memory"], self.lshwinfo["display"], self.lshwinfo["system"]) ) |
if n.getAttribute("id") == "cpu": | if n.getAttribute("id") == "core": tempa1 = n.getElementsByTagName("product")[0].childNodes[0].nodeValue tempa2 = n.getElementsByTagName("vendor")[0].childNodes[0].nodeValue if re.match(r'MICRO-STAR INTERNATIONAL', tempa2, re.IGNORECASE): temp_final2 = "MSI" elif re.match(r'Gigabyte Technology', tempa2, re.IGNORECAS... | def lshw(self): """ Runs lshw and sets self.lshwxml variable if not already set """ if not self.lshwinfo: if not self.lshwxml: self.lshwxml = self.runcommand(["sudo", "lshw", "-xml"]) # Fix bug: https://bugs.launchpad.net/bugs/512251 lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', ... |
def __init__(self): | def __init__(self, fxml=""): | def __init__(self): # unicode("Πολύ καλές", "utf-8") self.lshwxml = "" self.lshwinfo = {} self.lshw() self.knowledge() self.osinfo() self.specs() |
self.lshwinfo = {} self.lshw() | self.lshwinfo = { "cpu": self.unknown, "memory": self.unknown, "display": list(self.unknown), "system": self.unknown, "core": self.unknown, } self.lshw(fxml) | def __init__(self): # unicode("Πολύ καλές", "utf-8") self.lshwxml = "" self.lshwinfo = {} self.lshw() self.knowledge() self.osinfo() self.specs() |
s = { "linux": u"Άγνωστο", "programming": u"Άγνωστο", "english": u"Άγνωστο" | s = { "linux": self.unknown, "programming": self.unknown, "english": self.unknown | def knowledge(self): s = { "linux": u"Άγνωστο", "programming": u"Άγνωστο", "english": u"Άγνωστο" } print( u"Γνώσεις ⇛ Linux: %s ┃ Προγραμματισμός: %s ┃ Αγγλικά: %s" % (s["linux"], s["programming"], s["english"]) ) |
mtype = "x-bit" | mtype = "%s-bit" % self.unknown | def machinearch(self): output = os.uname()[4] if output == "x86_64": mtype = "64-bit" elif re.match(r'i686|i386', output): mtype = "32-bit" else: mtype = "x-bit" return mtype |
print( u'Προδιαγραφές ⇛ %s │ RAM %s MiB │ %s│ Μητρική: %s (%s)' % | print( u'Προδιαγραφές ⇛ %s │ RAM %s MiB │ Κάρτα γραφικών: %s │ Μητρική: %s - %s' % | def specs(self): print( u'Προδιαγραφές ⇛ %s │ RAM %s MiB │ %s│ Μητρική: %s (%s)' % (self.lshwinfo["cpu"], self.lshwinfo["memory"], self.lshwinfo["display"], self.lshwinfo["system"], self.lshwinfo["core"] ) ) |
self.lshwinfo["display"], | ', '.join(self.lshwinfo["display"]), | def specs(self): print( u'Προδιαγραφές ⇛ %s │ RAM %s MiB │ %s│ Μητρική: %s (%s)' % (self.lshwinfo["cpu"], self.lshwinfo["memory"], self.lshwinfo["display"], self.lshwinfo["system"], self.lshwinfo["core"] ) ) |
def cpuinfo(self): print("CPU: %s" % self.lshwinfo["cpu"]) def display(self): print("Display: %s" % self.lshwinfo["display"]) def memory(self): print("Memory: %d MiB" % self.lshwinfo["memory"]) def mainboard(self): print("Mainboard: %s" % self.lshwinfo["system"]) def lshw(self): | def lshw(self, fxml=""): | def cpuinfo(self): print("CPU: %s" % self.lshwinfo["cpu"]) |
if not self.lshwinfo: if not self.lshwxml: | if not self.lshwxml: if fxml: f = open(fxml) self.lshwxml = f.read() f.close() print("\n\nUsing lshw xml file: %s" % fxml) else: | def lshw(self): """ Runs lshw and sets self.lshwxml variable if not already set """ if not self.lshwinfo: if not self.lshwxml: self.lshwxml = self.runcommand(["sudo", "lshw", "-xml"]) # Fix bug: https://bugs.launchpad.net/bugs/512251 lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', ... |
lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', l): lines.remove(l) self.lshwxml = '\n'.join(lines) doc = xml.dom.minidom.parseString(self.lshwxml) nodes = doc.getElementsByTagName("node") found_motherboard = False for n in nodes: if n.hasAttribute("class") and n.getAttribute("clas... | lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', l): lines.remove(l) self.lshwxml = '\n'.join(lines) doc = xml.dom.minidom.parseString(self.lshwxml) nodes = doc.getElementsByTagName("node") found_motherboard = False for n in nodes: if n.hasAttribute("class") and \ n.getAttribute("cl... | def lshw(self): """ Runs lshw and sets self.lshwxml variable if not already set """ if not self.lshwinfo: if not self.lshwxml: self.lshwxml = self.runcommand(["sudo", "lshw", "-xml"]) # Fix bug: https://bugs.launchpad.net/bugs/512251 lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', ... |
elif re.match(r'Gigabyte Technology Co\., Ltd\.', tempa2, re.IGNORECASE): | elif re.match(r'Gigabyte Technology', tempa2, re.IGNORECASE): | def lshw(self): """ Runs lshw and sets self.lshwxml variable if not already set """ if not self.lshwinfo: if not self.lshwxml: self.lshwxml = self.runcommand(["sudo", "lshw", "-xml"]) # Fix bug: https://bugs.launchpad.net/bugs/512251 lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', ... |
if temp_final2 != "To Be Filled By O.E.M.": | if temp_final2 != "To Be Filled By O.E.M." and temp_final2 != "System manufacturer": | def lshw(self): """ Runs lshw and sets self.lshwxml variable if not already set """ if not self.lshwinfo: if not self.lshwxml: self.lshwxml = self.runcommand(["sudo", "lshw", "-xml"]) # Fix bug: https://bugs.launchpad.net/bugs/512251 lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', ... |
self.lshwinfo["system"] = "%s %s" % (temp_final2, tempa1) | else: temp_final2 = "" tempa1 = "" if not temp_final2: self.lshwinfo["core"] = self.unknown else: self.lshwinfo["core"] = "%s %s" % (temp_final2, tempa1) | def lshw(self): """ Runs lshw and sets self.lshwxml variable if not already set """ if not self.lshwinfo: if not self.lshwxml: self.lshwxml = self.runcommand(["sudo", "lshw", "-xml"]) # Fix bug: https://bugs.launchpad.net/bugs/512251 lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', ... |
if n.hasAttribute("id"): if n.getAttribute("id") == "core": tempa1 = n.getElementsByTagName("product")[0].childNodes[0].nodeValue tempa2 = n.getElementsByTagName("vendor")[0].childNodes[0].nodeValue if re.match(r'MICRO-STAR INTERNATIONAL', tempa2, re.IGNORECASE): temp_final2 = "MSI" elif re.match(r'Gigabyte Technolo... | elif re.match(r'cpu(?::\n)?', n.getAttribute("id")): try: | def lshw(self): """ Runs lshw and sets self.lshwxml variable if not already set """ if not self.lshwinfo: if not self.lshwxml: self.lshwxml = self.runcommand(["sudo", "lshw", "-xml"]) # Fix bug: https://bugs.launchpad.net/bugs/512251 lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', ... |
if tempa[0:5] == "Intel": | if tempa[0:5] == "Intel" or tempa[0:7] == "Pentium": | def lshw(self): """ Runs lshw and sets self.lshwxml variable if not already set """ if not self.lshwinfo: if not self.lshwxml: self.lshwxml = self.runcommand(["sudo", "lshw", "-xml"]) # Fix bug: https://bugs.launchpad.net/bugs/512251 lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', ... |
elif n.getAttribute("id") == "display": tempa1 = n.getElementsByTagName("product")[0].childNodes[0].nodeValue tempa2 = n.getElementsByTagName("vendor")[0].childNodes[0].nodeValue if tempa2[0:6] == "nVidia": temp_final2 = re.sub(r'(?i)\sCorporation', '', tempa2) elif tempa2[0:3] == "ATI": temp_final2 = re.sub(r'(?i)\s... | except IndexError: pass elif re.match(r'display(?::\n)?', n.getAttribute("id")): tempa1 = n.getElementsByTagName("product")[0].childNodes[0].nodeValue tempa2 = n.getElementsByTagName("vendor")[0].childNodes[0].nodeValue if tempa2[0:6] == "nVidia": temp_final2 = re.sub(r'(?i)\sCorporation', '', tempa2) elif tempa2[0:... | def lshw(self): """ Runs lshw and sets self.lshwxml variable if not already set """ if not self.lshwinfo: if not self.lshwxml: self.lshwxml = self.runcommand(["sudo", "lshw", "-xml"]) # Fix bug: https://bugs.launchpad.net/bugs/512251 lines = self.lshwxml.split("\n") for l in lines: if re.search(r'id="lastmountpoint"', ... |
core() | try: arg = sys.argv[1] except IndexError: arg = "" core(fxml=arg) | def main(): #print("YO!") core() |
size = [size[0], size[1]] | size = [size[0], size[1].replace(' ','')] | def get_size(self, output): m = re.search('Video: [^\\n]*\\n', output) #pprint('%s' % m.group(0)) m = m.group(0).replace('Video: ', '').replace('\n', '').split(', ') #pprint("m = %s" % m) # Sometime it returns a '[blabla]', remove it size = m[2].split('[') size = size[0].split('x') #ratio = float(size[0])/float(size[1]... |
SRVConnectorClass = None | SRVConnectorClass = MSRPSRVConnector | def timeout(cls, *throw_args): if not throw_args: throw_args = (cls, ) return timeout(cls.seconds, *throw_args) |
self.term_buf_len = 12 + len(self.data.transaction_id) self.term_buf = "" self.term = re.compile("^(.*)\r\n-------%s([$ | terminator = '\r\n-------' + self.data.transaction_id continue_flags = [c+'\r\n' for c in '$ self.term_buf = '' self.term_re = re.compile("^(.*)%s([$ self.term_substrings = [terminator[:i] for i in xrange(1, len(terminator)+1)] + [terminator+cont[:i] for cont in continue_flags for i in xrange(1, len(cont))] self.term_s... | def lineReceived(self, line): if self.data: if len(line) == 0: self.term_buf_len = 12 + len(self.data.transaction_id) self.term_buf = "" self.term = re.compile("^(.*)\r\n-------%s([$#+])\r\n(.*)$" % re.escape(self.data.transaction_id), re.DOTALL) self._recepient.logger.received_new_chunk(self._chunk_header+self.delimit... |
match = self.term.match(line) | match = self.term_re.match(line) | def lineReceived(self, line): if self.data: if len(line) == 0: self.term_buf_len = 12 + len(self.data.transaction_id) self.term_buf = "" self.term = re.compile("^(.*)\r\n-------%s([$#+])\r\n(.*)$" % re.escape(self.data.transaction_id), re.DOTALL) self._recepient.logger.received_new_chunk(self._chunk_header+self.delimit... |
self.term = re.compile("^-------%s([$ | self.term_re = re.compile("^-------%s([$ | def lineReceived(self, line): if self.data: if len(line) == 0: self.term_buf_len = 12 + len(self.data.transaction_id) self.term_buf = "" self.term = re.compile("^(.*)\r\n-------%s([$#+])\r\n(.*)$" % re.escape(self.data.transaction_id), re.DOTALL) self._recepient.logger.received_new_chunk(self._chunk_header+self.delimit... |
match_data = self.term_buf + data match = self.term.match(match_data) | data = self.term_buf + data match = self.term_re.match(data) | def rawDataReceived(self, data): match_data = self.term_buf + data match = self.term.match(match_data) if match: # we got the last data for this message contents, continuation, extra = match.groups() contents = contents[len(self.term_buf):] if contents: self._recepient.logger.received_chunk_data(contents, self.transpor... |
contents = contents[len(self.term_buf):] | def rawDataReceived(self, data): match_data = self.term_buf + data match = self.term.match(match_data) if match: # we got the last data for this message contents, continuation, extra = match.groups() contents = contents[len(self.term_buf):] if contents: self._recepient.logger.received_chunk_data(contents, self.transpor... | |
self.term_buf = match_data[-self.term_buf_len:] | def rawDataReceived(self, data): match_data = self.term_buf + data match = self.term.match(match_data) if match: # we got the last data for this message contents, continuation, extra = match.groups() contents = contents[len(self.term_buf):] if contents: self._recepient.logger.received_chunk_data(contents, self.transpor... | |
return md5.new(ha1_text).hexdigest() | return md5(ha1_text).hexdigest() | def calc_ha1(**parameters): ha1_text = "%(username)s:%(realm)s:%(password)s" % parameters return md5.new(ha1_text).hexdigest() |
return md5.new(ha2_text).hexdigest() | return md5(ha2_text).hexdigest() | def calc_ha2_response(**parameters): ha2_text = "%(method)s:%(uri)s" % parameters return md5.new(ha2_text).hexdigest() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.