bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | 463,100 |
def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | 463,101 |
def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | 463,102 |
def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | 463,103 |
def make_non_redundant(self, meta, plname=None, plist=None): '''build a non-redundant version of a list of packages | def make_non_redundant(self, meta, plname=None, plist=None): '''build a non-redundant version of a list of packages | 463,104 |
def _loadConfig(self): # Process the YUMng section from the config file. CP = Parser() CP.read(self.setup.get('setup')) | def _loadConfig(self): # Process the YUMng section from the config file. CP = Parser() CP.read(self.setup.get('setup')) | 463,105 |
def _loadConfig(self): # Process the YUMng section from the config file. CP = Parser() CP.read(self.setup.get('setup')) | def _loadConfig(self): # Process the YUMng section from the config file. CP = Parser() CP.read(self.setup.get('setup')) | 463,106 |
def VerifyPackage(self, entry, modlist, pinned_version=None): """ Verify Package status for entry. Performs the following: - Checks for the presence of required Package Instances. - Compares the evra 'version' info against self.installed{}. - RPM level package verify (rpm --verify). - Checks for the presence of unrequi... | def VerifyPackage(self, entry, modlist, pinned_version=None): """ Verify Package status for entry. Performs the following: - Checks for the presence of required Package Instances. - Compares the evra 'version' info against self.installed{}. - RPM level package verify (rpm --verify). - Checks for the presence of unrequi... | 463,107 |
def VerifyPackage(self, entry, modlist, pinned_version=None): """ Verify Package status for entry. Performs the following: - Checks for the presence of required Package Instances. - Compares the evra 'version' info against self.installed{}. - RPM level package verify (rpm --verify). - Checks for the presence of unrequi... | def VerifyPackage(self, entry, modlist, pinned_version=None): """ Verify Package status for entry. Performs the following: - Checks for the presence of required Package Instances. - Compares the evra 'version' info against self.installed{}. - RPM level package verify (rpm --verify). - Checks for the presence of unrequi... | 463,108 |
def VerifyPackage(self, entry, modlist, pinned_version=None): """ Verify Package status for entry. Performs the following: - Checks for the presence of required Package Instances. - Compares the evra 'version' info against self.installed{}. - RPM level package verify (rpm --verify). - Checks for the presence of unrequi... | def VerifyPackage(self, entry, modlist, pinned_version=None): """ Verify Package status for entry. Performs the following: - Checks for the presence of required Package Instances. - Compares the evra 'version' info against self.installed{}. - RPM level package verify (rpm --verify). - Checks for the presence of unrequi... | 463,109 |
def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | def Install(self, packages, states): """ Try and fix everything that YUMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | 463,110 |
def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded. | 463,111 |
def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | 463,112 |
def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | 463,113 |
def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | 463,114 |
def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | def queuePkg(pkg, inst, queue): if pkg.get('name') == 'gpg-pubkey': gpg_keys.append(inst) else: queue.append(inst) | 463,115 |
def VerifyService(self, entry, _): '''Verify Service status for entry | def VerifyService(self, entry, _): '''Verify Service status for entry | 463,116 |
def VerifyService(self, entry, _): '''Verify Service status for entry | def VerifyService(self, entry, _): '''Verify Service status for entry | 463,117 |
def VerifyService(self, entry, _): '''Verify Service status for entry | def VerifyService(self, entry, _): '''Verify Service status for entry | 463,118 |
def bind_entry(self, entry, metadata): '''Return the appropriate interpreted template from the set of available templates''' self.bind_info_to_entry(entry, metadata) matching = self.get_matching(metadata) | def bind_entry(self, entry, metadata): '''Return the appropriate interpreted template from the set of available templates''' self.bind_info_to_entry(entry, metadata) matching = self.get_matching(metadata) | 463,119 |
def get_client_names_by_groups(self, groups): gprofiles = [profile for profile in self.profiles if \ self.groups[profile][1].issuperset(groups)] return self.get_client_names_by_profiles(gprofiles) | def get_client_names_by_groups(self, groups): gprofiles = [profile for profile in self.profiles if \ self.groups[profile][1].issuperset(groups)] return self.get_client_names_by_profiles(gprofiles) | 463,120 |
def dosync(): """Function to do the syncronisation for the models""" # try to detect if it's a fresh new database try: cursor = connection.cursor() # If this table goes missing then don't forget to change it to the new one cursor.execute("Select * from reports_client") # if we get here with no error then the database h... | def dosync(): """Function to do the syncronisation for the models""" # try to detect if it's a fresh new database try: cursor = connection.cursor() # If this table goes missing then don't forget to change it to the new one cursor.execute("Select * from reports_client") # if we get here with no error then the database h... | 463,121 |
def GenerateHostKeys(self, client): '''Generate new host keys for client''' keylist = [keytmpl % client for keytmpl in self.hostkeys] for hostkey in keylist: if 'ssh_host_rsa_key.H_' == hostkey[:19]: keytype = 'rsa' elif 'ssh_host_dsa_key.H_' == hostkey[:19]: keytype = 'dsa' else: keytype = 'rsa1' | def GenerateHostKeys(self, client): '''Generate new host keys for client''' keylist = [keytmpl % client for keytmpl in self.hostkeys] for hostkey in keylist: if 'ssh_host_rsa_key.H_' == hostkey[:19]: keytype = 'rsa' elif 'ssh_host_dsa_key.H_' == hostkey[:19]: keytype = 'dsa' else: keytype = 'rsa1' | 463,122 |
def read_files(self): bdeps = dict() bprov = dict() for fname in self.files: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if barch not in bdeps: bdeps[barch] = dict() bprov[barch] = dict() try: reader = gzip.GzipFile(fname) except: print("Failed to read file %s" % fname) raise for line in rea... | def read_files(self): bdeps = dict() bprov = dict() for fname in self.files: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if barch not in bdeps: bdeps[barch] = dict() bprov[barch] = dict() try: reader = gzip.GzipFile(fname) except: print("Failed to read file %s" % fname) raise for line in rea... | 463,123 |
def get_request(self): (sock, sockinfo) = self.socket.accept() sock.settimeout(90) sslsock = ssl.wrap_socket(sock, server_side=True, certfile=self.certfile, keyfile=self.keyfile, cert_reqs=self.mode, ca_certs=self.ca, ssl_version=self.ssl_protocol) return sslsock, sockinfo | def get_request(self): (sock, sockinfo) = self.socket.accept() sslsock = ssl.wrap_socket(sock, server_side=True, certfile=self.certfile, keyfile=self.keyfile, cert_reqs=self.mode, ca_certs=self.ca, ssl_version=self.ssl_protocol) return sslsock, sockinfo | 463,124 |
def finish(self): # shut down the connection if not self.wfile.closed: self.wfile.flush() self.wfile.close() self.rfile.close() self.connection.unwrap() self.connection.close() os.close(self.connection.fileno()) | def finish(self): # shut down the connection if not self.wfile.closed: self.wfile.flush() self.wfile.close() self.rfile.close() self.connection.unwrap() self.connection.close() os.close(self.connection.fileno()) | 463,125 |
def source_from_xml(xsource): ret = dict([('rawurl', False), ('url', False)]) for key, tag in [('groups', 'Group'), ('components', 'Component'), ('arches', 'Arch'), ('blacklist', 'Blacklist')]: ret[key] = [item.text for item in xsource.findall(tag)] # version and component need to both contain data for sources to work ... | def source_from_xml(xsource): ret = dict([('rawurl', False), ('url', False)]) for key, tag in [('groups', 'Group'), ('components', 'Component'), ('arches', 'Arch'), ('blacklist', 'Blacklist')]: ret[key] = [item.text for item in xsource.findall(tag)] # version and component need to both contain data for sources to work ... | 463,126 |
def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended) self.cachefile = self.escape_url(self.url + '@' + version) + '.data' self.pkgnames = set() | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, recommended) if not self.rawurl: self.cachefile = self.escape_url(self.url + '@' + self.version) + '.data' else: self.cache... | 463,127 |
def get_urls(self): return ["%sdists/%s/%s/binary-%s/Packages.gz" % \ (self.url, self.version, part, arch) for part in self.components \ for arch in self.arches] | def get_urls(self): return ["%sdists/%s/%s/binary-%s/Packages.gz" % \ (self.url, self.version, part, arch) for part in self.components \ for arch in self.arches] | 463,128 |
def get_urls(self): return ["%sdists/%s/%s/binary-%s/Packages.gz" % \ (self.url, self.version, part, arch) for part in self.components \ for arch in self.arches] | def get_urls(self): return ["%sdists/%s/%s/binary-%s/Packages.gz" % \ (self.url, self.version, part, arch) for part in self.components \ for arch in self.arches] | 463,129 |
def read_files(self): bdeps = dict() bprov = dict() if self.recommended: depfnames = ['Depends', 'Pre-Depends', 'Recommends'] else: depfnames = ['Depends', 'Pre-Depends'] for fname in self.files: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if barch not in bdeps: bdeps[barch] = dict() bprov[b... | def read_files(self): bdeps = dict() bprov = dict() if self.recommended: depfnames = ['Depends', 'Pre-Depends', 'Recommends'] else: depfnames = ['Depends', 'Pre-Depends'] for fname in self.files: if not self.rawurl: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] else: barch = self.arches[0] i... | 463,130 |
def VerifyPackage(self, entry, modlist): pinned_version = None if entry.get('version', False) == 'auto': # old style entry; synthesize Instances from current installed if entry.get('name') not in self.yum_installed and \ entry.get('name') not in self.yum_avail: # new entry; fall back to default entry.set('version', 'an... | def VerifyPackage(self, entry, modlist): pinned_version = None if entry.get('version', False) == 'auto': # old style entry; synthesize Instances from current installed if entry.get('name') not in self.yum_installed and \ entry.get('name') not in self.yum_avail: # new entry; fall back to default entry.set('version', 'an... | 463,131 |
def do_POST(self): try: max_chunk_size = 10*1024*1024 size_remaining = int(self.headers["content-length"]) L = [] while size_remaining: try: select.select([self.rfile.fileno()], [], [], 3) except select.error: print "got select timeout" raise chunk_size = min(size_remaining, max_chunk_size) L.append(self.rfile.read(chu... | def do_POST(self): try: max_chunk_size = 10*1024*1024 size_remaining = int(self.headers["content-length"]) L = [] while size_remaining: try: select.select([self.rfile.fileno()], [], [], 3) except select.error: print "got select timeout" raise chunk_size = min(size_remaining, max_chunk_size) L.append(self.rfile.read(chu... | 463,132 |
def do_POST(self): try: max_chunk_size = 10*1024*1024 size_remaining = int(self.headers["content-length"]) L = [] while size_remaining: try: select.select([self.rfile.fileno()], [], [], 3) except select.error: print "got select timeout" raise chunk_size = min(size_remaining, max_chunk_size) L.append(self.rfile.read(chu... | def do_POST(self): try: max_chunk_size = 10*1024*1024 size_remaining = int(self.headers["content-length"]) L = [] while size_remaining: try: select.select([self.rfile.fileno()], [], [], 3) except select.error: print "got select timeout" raise chunk_size = min(size_remaining, max_chunk_size) L.append(self.rfile.read(chu... | 463,133 |
def dosync(): """Function to do the syncronisation for the models""" # try to detect if it's a fresh new database try: cursor = connection.cursor() # If this table goes missing then don't forget to change it to the new one cursor.execute("Select * from reports_client") # if we get here with no error then the database h... | def dosync(): """Function to do the syncronisation for the models""" # try to detect if it's a fresh new database try: cursor = connection.cursor() # If this table goes missing then don't forget to change it to the new one cursor.execute("Select * from reports_client") # if we get here with no error then the database h... | 463,134 |
def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, whitelist, recommended): self.basepath = basepath self.version = version self.components = components self.url = url self.rawurl = rawurl self.groups = groups self.arches = arches self.deps = dict() self.provides = dict() self.bla... | def __init__(self, basepath, url, version, arches, components, groups, rawurl, blacklist, whitelist, recommended): self.basepath = basepath self.version = version self.components = components self.url = url self.rawurl = rawurl self.groups = groups self.arches = arches self.deps = dict() self.provides = dict() self.bla... | 463,135 |
def setup_data(self, force_update=False): should_read = True should_download = False if os.path.exists(self.cachefile): try: self.load_state() should_read = False except: logger.error("Cachefile %s load failed; falling back to file read"\ % (self.cachefile)) if should_read: try: self.read_files() except: logger.error("... | def setup_data(self, force_update=False): should_read = True should_download = False if os.path.exists(self.cachefile): try: self.load_state() should_read = False except: logger.error("Cachefile %s load failed; falling back to file read"\ % (self.cachefile)) if should_read: try: self.read_files() except: logger.error("... | 463,136 |
def read_files(self): bdeps = dict() bprov = dict() if self.recommended: depfnames = ['Depends', 'Pre-Depends', 'Recommends'] else: depfnames = ['Depends', 'Pre-Depends'] for fname in self.files: if not self.rawurl: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] else: # RawURL entries assume th... | def read_files(self): bdeps = dict() bprov = dict() if self.recommended: depfnames = ['Depends', 'Pre-Depends', 'Recommends'] else: depfnames = ['Depends', 'Pre-Depends'] for fname in self.files: if not self.rawurl: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] else: # RawURL entries assume th... | 463,137 |
def get_urls(self): if not self.rawurl: return ["%s/%s/os/%s/%s.db.tar.gz" % \ (self.url, part, arch, part) for part in self.components \ for arch in self.arches] else: raise Exception("PACSource : RAWUrl not supported (yet)") | defget_urls(self):ifnotself.rawurl:return["%s/%s/os/%s/%s.db.tar.gz"%\(self.url,part,arch,part)forpartinself.components\forarchinself.arches]else:raiseException("PACSource:RAWUrlnotsupported(yet)") | 463,138 |
def read_files(self): bdeps = dict() bprov = dict() | def read_files(self): bdeps = dict() bprov = dict() | 463,139 |
def read_files(self): bdeps = dict() bprov = dict() | def read_files(self): bdeps = dict() bprov = dict() | 463,140 |
def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | def complete(self, meta, input_requirements, debug=False): '''Build the transitive closure of all package dependencies | 463,141 |
def validate_structures(self, meta, structures): '''Ensure client configurations include all needed prerequisites | def validate_structures(self, meta, structures): '''Ensure client configurations include all needed prerequisites | 463,142 |
def _load_config(self, force_update=False): ''' Load the configuration data and setup sources | def _load_config(self, force_update=False): ''' Load the configuration data and setup sources | 463,143 |
def HandleEvent(self, event=None): """ Updates which files this plugin handles based upon filesystem events. Allows configuration items to be added/removed without server restarts. """ action = event.code2str() if event.filename[0] == '/': return epath = "".join([self.data, self.handles[event.requestID], event.filename... | def HandleEvent(self, event=None): """ Updates which files this plugin handles based upon filesystem events. Allows configuration items to be added/removed without server restarts. """ action = event.code2str() if event.filename[0] == '/': return epath = "".join([self.data, self.handles[event.requestID], event.filename... | 463,144 |
def HandleEvent(self, event=None): """ Updates which files this plugin handles based upon filesystem events. Allows configuration items to be added/removed without server restarts. """ action = event.code2str() if event.filename[0] == '/': return epath = "".join([self.data, self.handles[event.requestID], event.filename... | def HandleEvent(self, event=None): """ Updates which files this plugin handles based upon filesystem events. Allows configuration items to be added/removed without server restarts. """ action = event.code2str() if event.filename[0] == '/': return epath = "".join([self.data, self.handles[event.requestID], event.filename... | 463,145 |
def get_key(self, entry, metadata): """ either grabs a prexisting key hostfile, or triggers the generation of a new key if one doesn't exist. """ # set path type and permissions, otherwise bcfg2 won't bind the file permdata = {'owner':'root', 'group':'root', 'type':'file', 'perms':'644'} [entry.attrib.__setitem__(key, ... | def get_key(self, entry, metadata): """ either grabs a prexisting key hostfile, or triggers the generation of a new key if one doesn't exist. """ # set path type and permissions, otherwise bcfg2 won't bind the file permdata = {'owner': 'root', 'group': 'root', 'type': 'file', 'perms': '644'} [entry.attrib.__setitem__(k... | 463,146 |
def get_key(self, entry, metadata): """ either grabs a prexisting key hostfile, or triggers the generation of a new key if one doesn't exist. """ # set path type and permissions, otherwise bcfg2 won't bind the file permdata = {'owner':'root', 'group':'root', 'type':'file', 'perms':'644'} [entry.attrib.__setitem__(key, ... | def get_key(self, entry, metadata): """ either grabs a prexisting key hostfile, or triggers the generation of a new key if one doesn't exist. """ # set path type and permissions, otherwise bcfg2 won't bind the file permdata = {'owner':'root', 'group':'root', 'type':'file', 'perms':'644'} [entry.attrib.__setitem__(key, ... | 463,147 |
def get_cert(self, entry, metadata): """ either grabs a prexisting cert hostfile, or triggers the generation of a new cert if one doesn't exist. """ # set path type and permissions, otherwise bcfg2 won't bind the file permdata = {'owner':'root', 'group':'root', 'type':'file', 'perms':'644'} [entry.attrib.__setitem__(ke... | def get_cert(self, entry, metadata): """ either grabs a prexisting cert hostfile, or triggers the generation of a new cert if one doesn't exist. """ # set path type and permissions, otherwise bcfg2 won't bind the file permdata = {'owner': 'root', 'group': 'root', 'type': 'file', 'perms': '644'} [entry.attrib.__setitem_... | 463,148 |
def verify_cert(self, filename, entry): """ check that a certificate validates against the ca cert, and that it has not expired. """ chaincert = self.CAs[self.cert_specs[entry.get('name')]['ca']].get('chaincert') cert = self.data + filename cmd = "openssl verify -CAfile %s %s" % (chaincert, cert) res = Popen(cmd, shell... | def verify_cert(self, filename, entry): """ check that a certificate validates against the ca cert, and that it has not expired. """ chaincert = self.CAs[self.cert_specs[entry.get('name')]['ca']].get('chaincert') cert = self.data + filename cmd = "openssl verify -CAfile %s %s" % (chaincert, cert) res = Popen(cmd, shell... | 463,149 |
def build_req_config(self, entry, metadata): """ generates a temporary openssl configuration file that is used to generate the required certificate request """ # create temp request config file conffile = open(tempfile.mkstemp()[1], 'w') cp = ConfigParser({}) cp.optionxform = str defaults = { 'req': { 'default_md': 'sh... | def build_req_config(self, entry, metadata): """ generates a temporary openssl configuration file that is used to generate the required certificate request """ # create temp request config file conffile = open(tempfile.mkstemp()[1], 'w') cp = ConfigParser({}) cp.optionxform = str defaults = { 'req': { 'default_md': 'sh... | 463,150 |
def read_files(self): bdeps = dict() bprov = dict() for fname in self.files: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if barch not in bdeps: bdeps[barch] = dict() bprov[barch] = dict() try: reader = gzip.GzipFile(fname) except: print("Failed to read file %s" % fname) raise for line in rea... | def read_files(self): bdeps = dict() bprov = dict() for fname in self.files: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if barch not in bdeps: bdeps[barch] = dict() bprov[barch] = dict() try: reader = gzip.GzipFile(fname) except: print("Failed to read file %s" % fname) raise for line in rea... | 463,151 |
def read_files(self): bdeps = dict() bprov = dict() for fname in self.files: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if barch not in bdeps: bdeps[barch] = dict() bprov[barch] = dict() try: reader = gzip.GzipFile(fname) except: print("Failed to read file %s" % fname) raise for line in rea... | def read_files(self): bdeps = dict() bprov = dict() for fname in self.files: barch = [x for x in fname.split('@') if x.startswith('binary-')][0][7:] if barch not in bdeps: bdeps[barch] = dict() bprov[barch] = dict() try: reader = gzip.GzipFile(fname) except: print("Failed to read file %s" % fname) raise for line in rea... | 463,152 |
def PullEntry(self, client, etype, ename): """Make currently recorded client state correct for entry.""" new_entry = self.BuildNewEntry(client, etype, ename) | def PullEntry(self, client, etype, ename): """Make currently recorded client state correct for entry.""" new_entry = self.BuildNewEntry(client, etype, ename) | 463,153 |
def PullEntry(self, client, etype, ename): """Make currently recorded client state correct for entry.""" new_entry = self.BuildNewEntry(client, etype, ename) | def PullEntry(self, client, etype, ename): """Make currently recorded client state correct for entry.""" new_entry = self.BuildNewEntry(client, etype, ename) | 463,154 |
def __init__(self, logger, setup, cfg): self.installed = {} self.pending_upgrades = set() self.image = image.Image() self.image.find_root('/', False) self.image.load_config() Bcfg2.Client.Tools.PkgTool.__init__(self, logger, cfg, setup) self.cfg = cfg | def __init__(self, logger, setup, cfg): self.installed = {} self.pending_upgrades = set() self.image = image.Image() self.image.find_root('/', False) self.image.load_config() Bcfg2.Client.Tools.PkgTool.__init__(self, logger, setup, cfg) self.cfg = cfg | 463,155 |
def page_navigator(context): """ Creates paginated links. Expects the context to be a RequestContext and views.prepare_paginated_list() to have populated page information. """ fragment = dict() try: path = context['request'].path total_pages = int(context['total_pages']) records_per_page = int(context['records_per_pag... | def page_navigator(context): """ Creates paginated links. Expects the context to be a RequestContext and views.prepare_paginated_list() to have populated page information. """ fragment = dict() try: path = context['request'].META['PATH_INFO'] total_pages = int(context['total_pages']) records_per_page = int(context['re... | 463,156 |
def filter_navigator(context): try: path = context['request'].path view, args, kwargs = resolve(path) # Strip any page limits and numbers if 'page_number' in kwargs: del kwargs['page_number'] if 'page_limit' in kwargs: del kwargs['page_limit'] filters = [] for filter in filter_list: if filter in kwargs: myargs = kwar... | def filter_navigator(context): try: path = context['request'].META['PATH_INFO'] view, args, kwargs = resolve(path) # Strip any page limits and numbers if 'page_number' in kwargs: del kwargs['page_number'] if 'page_limit' in kwargs: del kwargs['page_limit'] filters = [] for filter in filter_list: if filter in kwargs: ... | 463,157 |
def render(self, context): link = '#' try: path = context['request'].path view, args, kwargs = resolve(path) filter_value = self.filter_value.resolve(context, True) if filter_value: filter_name = smart_str(self.filter_name) filter_value = smart_unicode(filter_value) kwargs[filter_name] = filter_value # These two don't ... | def render(self, context): link = '#' try: path = context['request'].META['PATH_INFO'] view, args, kwargs = resolve(path) filter_value = self.filter_value.resolve(context, True) if filter_value: filter_name = smart_str(self.filter_name) filter_value = smart_unicode(filter_value) kwargs[filter_name] = filter_value # The... | 463,158 |
def __init__(self, core, datastore): Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore) Bcfg2.Server.Plugin.Generator.__init__(self) Bcfg2.Server.Plugin.PullTarget.__init__(self) try: Bcfg2.Server.Plugin.DirectoryBacked.__init__(self, self.data, self.core.fam) except OSError, ioerr: self.logger.error("Failed to... | def __init__(self, core, datastore): Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore) Bcfg2.Server.Plugin.Generator.__init__(self) Bcfg2.Server.Plugin.PullTarget.__init__(self) try: Bcfg2.Server.Plugin.DirectoryBacked.__init__(self, self.data, self.core.fam) except OSError, ioerr: self.logger.error("Failed to... | 463,159 |
def get_skn(self): '''build memory cache of the ssh known hosts file''' if not self.__skn: self.__skn = "\n".join([value.data for key, value in \ self.entries.iteritems() if \ key.endswith('.static')]) names = dict() # if no metadata is registered yet, defer if len(self.core.metadata.query.all()) == 0: self.__skn = Fal... | def get_skn(self): '''build memory cache of the ssh known hosts file''' if not self.__skn: self.__skn = "\n".join([value.data for key, value in \ self.entries.iteritems() if \ key.endswith('.static')]) names = dict() # if no metadata is registered yet, defer if len(self.core.metadata.query.all()) == 0: self.__skn = Fal... | 463,160 |
def get_skn(self): '''build memory cache of the ssh known hosts file''' if not self.__skn: self.__skn = "\n".join([value.data for key, value in \ self.entries.iteritems() if \ key.endswith('.static')]) names = dict() # if no metadata is registered yet, defer if len(self.core.metadata.query.all()) == 0: self.__skn = Fal... | def get_skn(self): '''build memory cache of the ssh known hosts file''' if not self.__skn: self.__skn = "\n".join([value.data for key, value in \ self.entries.iteritems() if \ key.endswith('.static')]) names = dict() # if no metadata is registered yet, defer if len(self.core.metadata.query.all()) == 0: self.__skn = Fal... | 463,161 |
def get_namecache_entry(self, cip): | def get_namecache_entry(self, cip): | 463,162 |
def __init__(self, logger, cfg, setup): self.installed = {} self.pending_upgrades = set() self.image = image.Image() self.image.find_root('/', False) self.image.load_config() Bcfg2.Client.Tools.PkgTool.__init__(self, logger, cfg, setup) self.cfg = cfg | def __init__(self, logger, setup, cfg): self.installed = {} self.pending_upgrades = set() self.image = image.Image() self.image.find_root('/', False) self.image.load_config() Bcfg2.Client.Tools.PkgTool.__init__(self, logger, cfg, setup) self.cfg = cfg | 463,163 |
def __init__(self, configfile, usage, pwhitelist=None, pblacklist=None): Mode.__init__(self, configfile) options = {'plugins': Bcfg2.Options.SERVER_PLUGINS} setup = Bcfg2.Options.OptionParser(options) setup.hm = usage setup.parse(sys.argv[1:]) if pwhitelist is not None: setup['plugins'] = [x for x in setup['plugins'] i... | def __init__(self, configfile, usage, pwhitelist=None, pblacklist=None): Mode.__init__(self, configfile) options = {'plugins': Bcfg2.Options.SERVER_PLUGINS, 'configfile': Bcfg2.Options.CFILE} setup = Bcfg2.Options.OptionParser(options) setup.hm = usage setup.parse(sys.argv[1:]) if pwhitelist is not None: setup['plugins... | 463,164 |
def Verifynonexistent(self, entry, _): # FIXME: not implemented return True | def Verifynonexistent(self, entry, _): # FIXME: not implemented return True | 463,165 |
def get_cert(self, entry, metadata): """ either grabs a prexisting cert hostfile, or triggers the generation of a new cert if one doesn't exist. """ # set path type and permissions, otherwise bcfg2 won't bind the file permdata = {'owner':'root', 'group':'root', 'type':'file', 'perms':'644'} [entry.attrib.__setitem__(ke... | def get_cert(self, entry, metadata): """ either grabs a prexisting cert hostfile, or triggers the generation of a new cert if one doesn't exist. """ # set path type and permissions, otherwise bcfg2 won't bind the file permdata = {'owner':'root', 'group':'root', 'type':'file', 'perms':'644'} [entry.attrib.__setitem__(ke... | 463,166 |
def verify_cert(self, filename, entry): """ check that a certificate validates against the ca cert, and that it has not expired. """ chaincert = self.CAs[self.cert_specs[entry.get('name')]['ca']].get('chaincert') cert = "".join([self.data, '/', filename]) cmd = "openssl verify -CAfile %s %s" % (chaincert, cert) proc = ... | def verify_cert(self, filename, entry): """ check that a certificate validates against the ca cert, and that it has not expired. """ chaincert = self.CAs[self.cert_specs[entry.get('name')]['ca']].get('chaincert') cert = self.data + filename cmd = "openssl verify -CAfile %s %s" % (chaincert, cert) proc = Popen(cmd, shel... | 463,167 |
def verify_cert(self, filename, entry): """ check that a certificate validates against the ca cert, and that it has not expired. """ chaincert = self.CAs[self.cert_specs[entry.get('name')]['ca']].get('chaincert') cert = "".join([self.data, '/', filename]) cmd = "openssl verify -CAfile %s %s" % (chaincert, cert) proc = ... | def verify_cert(self, filename, entry): """ check that a certificate validates against the ca cert, and that it has not expired. """ chaincert = self.CAs[self.cert_specs[entry.get('name')]['ca']].get('chaincert') cert = "".join([self.data, '/', filename]) cmd = "openssl verify -CAfile %s %s" % (chaincert, cert) proc = ... | 463,168 |
def build_cert(self, entry, metadata): """ creates a new certificate according to the specification """ req_config = self.build_req_config(entry, metadata) req = self.build_request(req_config, entry) ca = self.cert_specs[entry.get('name')]['ca'] ca_config = self.CAs[ca]['config'] days = self.cert_specs[entry.get('name'... | def build_cert(self, entry, metadata): """ creates a new certificate according to the specification """ req_config = self.build_req_config(entry, metadata) req = self.build_request(key_filename, req_config, entry) ca = self.cert_specs[entry.get('name')]['ca'] ca_config = self.CAs[ca]['config'] days = self.cert_specs[en... | 463,169 |
def resolve_requirement(self, metadata, requirement, packages, debug=False): '''Resolve requirement to packages and or additional requirements | def resolve_requirement(self, metadata, requirement, packages, debug=False): '''Resolve requirement to packages and or additional requirements | 463,170 |
def resolve_requirement(self, metadata, requirement, packages, debug=False): '''Resolve requirement to packages and or additional requirements | def resolve_requirement(self, metadata, requirement, packages, debug=False): '''Resolve requirement to packages and or additional requirements | 463,171 |
def __init__(self, basepath, url, version, arches, components, groups, rawurl): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl) if not self.rawurl: self.baseurl = self.url + '%(version)s/%(component)s/%(arch)s/' else: self.baseurl = self.rawurl self.cachefile = self.escape_url(self.bas... | def __init__(self, basepath, url, version, arches, components, groups, rawurl): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl) if not self.rawurl: self.baseurl = self.url + '%(version)s/%(component)s/%(arch)s/' else: self.baseurl = self.rawurl self.cachefile = self.escape_url(self.bas... | 463,172 |
def __init__(self, basepath, url, version, arches, components, groups, rawurl): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl) self.cachefile = self.escape_url(self.url) + '.data' self.pkgnames = set() | def __init__(self, basepath, url, version, arches, components, groups, rawurl): Source.__init__(self, basepath, url, version, arches, components, groups, rawurl) self.cachefile = self.escape_url(self.url + '@' + version) + '.data' self.pkgnames = set() | 463,173 |
def VerifyService(self, entry, _): '''Verify SMF Service Entry''' if not self.GetFMRI(entry): self.logger.error("smf service %s doesn't have FMRI set" % \ entry.get('name')) return False if entry.get('FMRI').startswith('lrc'): filename = entry.get('FMRI').split('/')[-1] # this is a legacy service gname = "/etc/rc*.d/%s... | def VerifyService(self, entry, _): '''Verify SMF Service Entry''' if not self.GetFMRI(entry): self.logger.error("smf service %s doesn't have FMRI set" % \ entry.get('name')) return False if entry.get('FMRI').startswith('lrc'): filename = entry.get('FMRI').split('/')[-1] # this is a legacy service gname = "/etc/rc*.d/%s... | 463,174 |
def delete(self, groupId, adminInfo): assert groupId, 'No group ID' assert adminInfo, 'No admin' if type(groupId) == unicode: groupId = groupId.encode('ascii', 'ignore') | def delete(self, groupId): assert groupId, 'No group ID' assert adminInfo, 'No admin' if type(groupId) == unicode: groupId = groupId.encode('ascii', 'ignore') | 463,175 |
def delete(self, groupId, adminInfo): assert groupId, 'No group ID' assert adminInfo, 'No admin' if type(groupId) == unicode: groupId = groupId.encode('ascii', 'ignore') | def delete(self, groupId, adminInfo): assert groupId, 'No group ID' if type(groupId) == unicode: groupId = groupId.encode('ascii', 'ignore') | 463,176 |
def delete(self, groupId, adminInfo): assert groupId, 'No group ID' assert adminInfo, 'No admin' if type(groupId) == unicode: groupId = groupId.encode('ascii', 'ignore') | def delete(self, groupId, adminInfo): assert groupId, 'No group ID' assert adminInfo, 'No admin' if type(groupId) == unicode: groupId = groupId.encode('ascii', 'ignore') | 463,177 |
def delete(self, groupId, adminInfo): assert groupId, 'No group ID' assert adminInfo, 'No admin' if type(groupId) == unicode: groupId = groupId.encode('ascii', 'ignore') | def delete(self, groupId, adminInfo): assert groupId, 'No group ID' assert adminInfo, 'No admin' if type(groupId) == unicode: groupId = groupId.encode('ascii', 'ignore') | 463,178 |
def delete_group_folder(self, groupId): # Create the group folder self.groupsFolder.manage_delFolder(groupId) assert not(hasattr(self.groupsFolder, groupId)) return group | def delete_group_folder(self, groupId): # Create the group folder self.groupsFolder.manage_delObjects([groupId,]) assert not(hasattr(self.groupsFolder, groupId)) return group | 463,179 |
def delete_group_folder(self, groupId): # Create the group folder self.groupsFolder.manage_delFolder(groupId) assert not(hasattr(self.groupsFolder, groupId)) return group | def delete_group_folder(self, groupId): # Create the group folder self.groupsFolder.manage_delFolder(groupId) assert not(hasattr(self.groupsFolder, groupId)) return group | 463,180 |
def del_user_group(self, group): memberGroup = '%s_member' % group.id self.site_root.acl_users.userFolderDelGroups([memberGroup]) | def delete_user_group(self, groupId): memberGroup = '%s_member' % groupId self.site_root.acl_users.userFolderDelGroups([memberGroup]) | 463,181 |
def delete_list(self, groupId): listManager = self.site_root.ListManager listManager.manage_delFolder(listManager.aq_explicit, groupId) | def delete_list(self, groupId): listManager = self.site_root.ListManager listManager.manage_delObjects([groupId,]) | 463,182 |
def __init__(self, parent=None, selectedScanner=None): QThread.__init__(self, parent) self.selectedScanner = selectedScanner self.im = None | def __init__(self, parent=None, selectedScanner=None): QThread.__init__(self, parent) self.selectedScanner = selectedScanner self.im = None | 463,183 |
def run(self): s = sane.open(self.selectedScanner) | def run(self): s = sane.open(self.selectedScanner) | 463,184 |
def __init__(self, parent=None, selectedScanner=None): QThread.__init__(self, parent) self.selectedScanner = selectedScanner self.im = None | def __init__(self, parent=None, selectedScanner=None): QThread.__init__(self, parent) self.selectedScanner = selectedScanner self.im = None | 463,185 |
def run(self): s = sane.open(self.selectedScanner) | def run(self): s = sane.open(self.selectedScanner) | 463,186 |
def event(self, event): """ Reimplemented to override shortcuts, if necessary. """ if self.override_shortcuts and \ event.type() == QtCore.QEvent.ShortcutOverride and \ event.modifiers() & QtCore.Qt.ControlModifier and \ event.key() in self._ctrl_down_remap: event.accept() return True else: return QtGui.QPlainTextEdit.... | def event(self, event): """ Reimplemented to override shortcuts, if necessary. """ if self.override_shortcuts and \ event.type() == QtCore.QEvent.ShortcutOverride and \ self._control_down(event.modifiers()) and \ event.key() in self._ctrl_down_remap: event.accept() return True else: return QtGui.QPlainTextEdit.event(se... | 463,187 |
def keyPressEvent(self, event): """ Reimplemented to create a console-like interface. """ intercepted = False cursor = self.textCursor() position = cursor.position() key = event.key() ctrl_down = event.modifiers() & QtCore.Qt.ControlModifier alt_down = event.modifiers() & QtCore.Qt.AltModifier shift_down = event.modifi... | def keyPressEvent(self, event): """ Reimplemented to create a console-like interface. """ intercepted = False cursor = self.textCursor() position = cursor.position() key = event.key() ctrl_down = self._control_down(event.modifiers()) alt_down = event.modifiers() & QtCore.Qt.AltModifier shift_down = event.modifiers() & ... | 463,188 |
def paste(self, mode=QtGui.QClipboard.Clipboard): """ Paste the contents of the clipboard into the input region. | def paste(self, mode=QtGui.QClipboard.Clipboard): """ Paste the contents of the clipboard into the input region. | 463,189 |
def paste(self): """ Paste the contents of the clipboard into the input region. """ if self._control.textInteractionFlags() & QtCore.Qt.TextEditable: try: text = str(QtGui.QApplication.clipboard().text()) except UnicodeEncodeError: pass else: self._insert_plain_text_into_buffer(dedent(text)) | def paste(self, mode=QtGui.QClipboard.Clipboard): """ Paste the contents of the clipboard into the input region. """ if self._control.textInteractionFlags() & QtCore.Qt.TextEditable: try: text = str(QtGui.QApplication.clipboard().text()) except UnicodeEncodeError: pass else: self._insert_plain_text_into_buffer(dedent(t... | 463,190 |
def paste(self): """ Paste the contents of the clipboard into the input region. """ if self._control.textInteractionFlags() & QtCore.Qt.TextEditable: try: text = str(QtGui.QApplication.clipboard().text()) except UnicodeEncodeError: pass else: self._insert_plain_text_into_buffer(dedent(text)) | def paste(self): """ Paste the contents of the clipboard into the input region. """ if self._control.textInteractionFlags() & QtCore.Qt.TextEditable: try: text = str(QtGui.QApplication.clipboard().text(mode)) except UnicodeEncodeError: pass else: self._insert_plain_text_into_buffer(dedent(text)) | 463,191 |
def _create_control(self): """ Creates and connects the underlying text widget. """ if self.kind == 'plain': control = ConsolePlainTextEdit() elif self.kind == 'rich': control = ConsoleTextEdit() control.setAcceptRichText(False) control.installEventFilter(self) control.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) ... | def _create_control(self): """ Creates and connects the underlying text widget. """ if self.kind == 'plain': control = ConsolePlainTextEdit() elif self.kind == 'rich': control = ConsoleTextEdit() control.setAcceptRichText(False) control.installEventFilter(self) control.viewport().installEventFilter(self) control.curs... | 463,192 |
def __init__(self, kind='plain', parent=None): """ Create a ConsoleWidget. Parameters ---------- kind : str, optional [default 'plain'] The type of text widget to use. Valid values are 'plain', which specifies a QPlainTextEdit, and 'rich', which specifies a QTextEdit. | def layout = QtGui.QVBoxLayout(self) layout.setMargin(0) __init__(self, layout = QtGui.QVBoxLayout(self) layout.setMargin(0) kind='plain', layout = QtGui.QVBoxLayout(self) layout.setMargin(0) parent=None): layout = QtGui.QVBoxLayout(self) layout.setMargin(0) """ layout = QtGui.QVBoxLayout(self) layout.setMargin(0) Crea... | 463,193 |
def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widget. """ if obj == self._control: etype = event.type() | def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widget. """ if obj == self._control: etype = event.type() | 463,194 |
def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widget. """ if obj == self._control: etype = event.type() | def eventFilter(self, obj, event): """ Reimplemented to ensure a console-like behavior in the underlying text widget. """ if obj == self._control: etype = event.type() | 463,195 |
def _create_control(self, kind): """ Creates and sets the underlying text widget. """ layout = QtGui.QVBoxLayout(self) layout.setMargin(0) if kind == 'plain': control = QtGui.QPlainTextEdit() elif kind == 'rich': control = QtGui.QTextEdit() control.setAcceptRichText(False) else: raise ValueError("Kind %s unknown." % re... | def _create_control(self, kind): """ Creates and connects the underlying text widget. """ if kind == 'plain': control = QtGui.QPlainTextEdit() elif kind == 'rich': control = QtGui.QTextEdit() control.setAcceptRichText(False) else: raise ValueError("Kind %s unknown." % repr(kind)) layout.addWidget(control) | 463,196 |
def _create_control(self, kind): """ Creates and sets the underlying text widget. """ layout = QtGui.QVBoxLayout(self) layout.setMargin(0) if kind == 'plain': control = QtGui.QPlainTextEdit() elif kind == 'rich': control = QtGui.QTextEdit() control.setAcceptRichText(False) else: raise ValueError("Kind %s unknown." % re... | def _create_control(self, kind): """ Creates and sets the underlying text widget. """ layout = QtGui.QVBoxLayout(self) layout.setMargin(0) if kind == 'plain': control = QtGui.QPlainTextEdit() elif kind == 'rich': control = QtGui.QTextEdit() control.setAcceptRichText(False) else: raise ValueError("Kind %s unknown." % re... | 463,197 |
def _create_control(self, kind): """ Creates and sets the underlying text widget. """ layout = QtGui.QVBoxLayout(self) layout.setMargin(0) if kind == 'plain': control = QtGui.QPlainTextEdit() elif kind == 'rich': control = QtGui.QTextEdit() control.setAcceptRichText(False) else: raise ValueError("Kind %s unknown." % re... | defcontrol.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) _create_control(self,control.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) kind):control.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) """control.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) Createscontrol.setVerticalScrol... | 463,198 |
def _event_filter_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ key = event.key() ctrl_down = self._control_key_down(event.modifiers()) # If the key is remapped, return immediately. if ctrl_down and key in self._ctrl_down_remap: new_event = QtGui.QK... | def _event_filter_keypress(self, event): """ Filter key events for the underlying text widget to create a console-like interface. """ key = event.key() ctrl_down = self._control_key_down(event.modifiers()) # If the key is remapped, return immediately. if ctrl_down and key in self._ctrl_down_remap: new_event = QtGui.QK... | 463,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.