rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
task.set_info("USER_handle_SIGHUP", False) | task.set_default("USER_handle_SIGUSR1", False) | def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() # Node selections optgr... |
task.set_info("USER_interactive", len(args) == 0 and not options.source_path) task.set_info("USER_running", False) | task.set_default("USER_interactive", len(args) == 0 and not options.source_path) task.set_default("USER_running", False) | def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() # Node selections optgr... |
if not task.info("USER_interactive"): | if not task.default("USER_interactive"): | def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() # Node selections optgr... |
elif task.info("USER_interactive"): | elif task.default("USER_interactive"): | def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() # Node selections optgr... |
if self.fire_date < other.fire_date: return -1 elif self.fire_date > other.fire_date: return 1 else: return 0 | return cmp(self.fire_date, other.fire_date) | def __cmp__(self, other): if self.fire_date < other.fire_date: return -1 elif self.fire_date > other.fire_date: return 1 else: return 0 |
self.reg_clients += 1 | if client.delayable: self.reg_clients += 1 | def register(self, client): """ Register an engine client. Subclasses that override this method should call base class method. """ assert client in self._clients or client in self._ports assert not client.registered |
tree.add(*tuple(line.rstrip('\r\n').split(': ', 1))) | node, line = line.rstrip('\r\n').split(':', 1) tree.add(node, line) | def clubak(): """Main clubak script function""" # # Argument management # usage = "%prog [-bcdL]" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) # Set parsing to stop on the first non-option parser.disable_interspersed_args() parser.add_option("-b", "-c", action="store_true", dest="gather", ... |
except ValueError, e: print >> sys.stderr, "clubak:", e sys.exit(1) | def clubak(): """Main clubak script function""" # # Argument management # usage = "%prog [-bcdL]" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) # Set parsing to stop on the first non-option parser.disable_interspersed_args() parser.add_option("-b", "-c", action="store_true", dest="gather", ... | |
task.excepthook = sys.excepthook = clush_excepthook | task.excepthook = sys.excepthook | def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() parser.add_option("--no... |
self.reg_clifds_has_changed = True | self.reg_clifds_changed = True | def modify(self, client, setmask, clearmask): """ Modify the next loop interest events bitset for a client. """ self._debug("MODEV set:0x%x clear:0x%x %s" % (setmask, clearmask, client)) client._new_events &= ~clearmask client._new_events |= setmask |
run_copy(task, options.source_path, options.dest_path, nodeset_base, 0, options.preserve_flag, display) | if not args: run_copy(task, options.source_path, options.dest_path, nodeset_base, 0, options.preserve_flag, display) else: parser.error("please use `--dest' to specify a different " \ "destination") | def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() parser.add_option("--no... |
cmd_l.append("-l %s" % user) | cmd_l.append("-l") cmd_l.append(user) | def _start(self): """ Start worker, initialize buffers, prepare command. """ task = self.worker.task |
cmd_l.append("-l %s" % user) | cmd_l.append("-l") cmd_l.append(user) | def _start(self): """ Start client, initialize buffers, prepare command. """ task = self.worker.task |
self.out.write("%s\n", line) | self.out.write("%s\n" % line) | def print_line(self, nodeset, line): """Display a line with optional label.""" if self.label: prefix = self.color_stdout_fmt % ("%s: " % nodeset) self.out.write("%s%s\n" % (prefix, line)) else: self.out.write("%s\n", line) |
self.err.write("%s\n", line) | self.err.write("%s\n" % line) | def print_line_error(self, nodeset, line): """Display an error line with optional label.""" if self.label: prefix = self.color_stderr_fmt % ("%s: " % nodeset) self.err.write("%s%s\n" % (prefix, line)) else: self.err.write("%s\n", line) |
else: | elif not abort: | def _close(self, abort, flush, timeout): """ Close client. See EngineClient._close(). """ if flush and self._rbuf: # We still have some read data available in buffer, but no # EOL. Generate a final message before closing. self.worker._on_msgline(self._rbuf) |
Create task's timer. | Create a timer bound to this task that fires at a preset time in the future by invoking the ev_timer() method of `handler' (provided EventHandler object). Timers can fire either only once or repeatedly at fixed time intervals. Repeating timers can also have their next firing time manually adjusted. The mandatory param... | def timer(self, fire, handler, interval=-1.0, autoclose=False): """ Create task's timer. """ assert fire >= 0.0, \ "timer's relative fire time must be a positive floating number" timer = EngineTimer(fire, interval, autoclose, handler) self._engine.add_timer(timer) return timer |
usage = "%prog [-bcdL]" | usage = "%prog [options]" | def clubak(): """Main clubak script function""" # # Argument management # usage = "%prog [-bcdL]" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) # Set parsing to stop on the first non-option parser.disable_interspersed_args() parser.add_option("-b", "-c", action="store_true", dest="gather", ... |
node, line = line.rstrip('\r\n').split(':', 1) tree.add(node, line) | node, content = line.rstrip('\r\n').split(options.separator, 1) if not node: raise ValueError("No node found for line: %s" % line.rstrip('\r\n')) tree.add(node, content) | def clubak(): """Main clubak script function""" # # Argument management # usage = "%prog [-bcdL]" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) # Set parsing to stop on the first non-option parser.disable_interspersed_args() parser.add_option("-b", "-c", action="store_true", dest="gather", ... |
fcntl.fcntl(sys.stdin, fcntl.F_SETFL, os.O_NDELAY) | fcntl.fcntl(sys.stdin, fcntl.F_SETFL, \ fcntl.fcntl(sys.stdin, fcntl.F_GETFL) | os.O_NDELAY) | def bind_stdin(worker): assert not sys.stdin.isatty() # Switch stdin to non blocking mode fcntl.fcntl(sys.stdin, fcntl.F_SETFL, os.O_NDELAY) # Create a simple worker attached to stdin in autoclose mode worker_stdin = WorkerSimple(sys.stdin, None, None, None, handler=StdInputHandler(worker), timeout=-1, autoclose=True)... |
if not sys.stdin.isatty(): | if task.default("USER_stdin_worker"): | def run_command(task, cmd, ns, gather, timeout, label, verbosity): """ Create and run the specified command line, displaying results in a dshbak way when gathering is used. """ task.set_default("USER_running", True) if gather: runtimer = None if verbosity == VERB_STD or verbosity == VERB_VERB: # Create a ClusterShell ... |
config.verbose_print(VERB_DEBUG, "Final NodeSet is %s" % nodeset_base) | config.verbose_print(VERB_DEBUG, "Final NodeSet: %s" % nodeset_base) | def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() # Node selections optgr... |
ns_cmp = lambda x, y: cmp(len(y), len(x)) or \ cmp(NodeSet.fromlist([x[0], y[0]])[0], y[0]) for nodeset in sorted(imap(ns_getter, tree.walk()), cmp=ns_cmp): | for nodeset in sorted(imap(ns_getter, tree.walk()), cmp=nodeset_cmp): | def display(tree, line_mode, gather): """Display results""" try: if gather: # lambda to create a NodeSet from keys list returned by walk() ns_getter = lambda x: NodeSet.fromlist(x[1]) # lambda to compare 2 nodesets by their length (we want larger # nodeset first) and then by first node ns_cmp = lambda x, y: cmp(len(y)... |
self.reg_clifds_changed = True | if clearmask: self.reg_clifds_changed = True | def modify(self, client, setmask, clearmask): """ Modify the next loop interest events bitset for a client. """ self._debug("MODEV set:0x%x clear:0x%x %s" % (setmask, clearmask, client)) client._new_events &= ~clearmask client._new_events |= setmask |
print "clush: %s: exited with exit code %s" % (ns, rc) | print >>sys.stderr, "clush: %s: exited with exit code %s" % (ns, rc) | def ev_close(self, worker): # Worker is closing -- it's time to gather results... if self._runtimer: self._runtimer.eh.finalize(worker.task.info("USER_interactive")) |
print "clush: %s: exited with exit code %s" % (ns, rc) | print >>sys.stderr, \ "clush: %s: exited with exit code %s" % (ns, rc) | def ttyloop(task, nodeset, gather, timeout, label, verbosity): """Manage the interactive prompt to run command""" has_readline = False if task.info("USER_interactive"): assert sys.stdin.isatty() readline_avail = False try: import readline readline_setup() readline_avail = True except ImportError: pass if verbosity >= V... |
stdin_isatty = sys.stdin.isatty() if stdin_isatty: | user_interaction = sys.stdin.isatty() and sys.stdout.isatty() if user_interaction: | def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() # Node selections optgr... |
if stdin_isatty: | if user_interaction: | def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() # Node selections optgr... |
except ClushConfigError, e: print >>sys.stderr, "ERROR: %s" % e sys.exit(1) | def clush_main(args): """Main clush script function""" # Default values nodeset_base, nodeset_exclude = NodeSet(), NodeSet() # # Argument management # usage = "%prog [options] command" parser = optparse.OptionParser(usage, version="%%prog %s" % __version__) parser.disable_interspersed_args() # Node selections optgr... | |
parser.add_option("--pidfile", dest="pidfile", default="./coilmq.pid", help="The PID file to use.") parser.add_option("-u", "--uid", dest="uid", help="The user/UID to use for daemon process.", metavar="UID") parser.add_option("-g", "--gid", dest="gid", help="The group/GID to use for daemon process.", metavar="GID") ... | def main(): """ Start the socket server. """ parser = OptionParser() parser.add_option("-c", "--config", dest="config_file", help="Read configuration from FILE. (CLI options override config file.)", metavar="FILE") parser.add_option("-b", "--host", dest="listen_addr", help="Listen on specified address (default 0.0.0.... | |
server = server_from_config() | if options.daemon: if not daemon_support: raise ConfigError("This environment/platform does not support running as daemon. (Are you running on *nix and did you install python-daemon package?)") else: context = daemon.DaemonContext() if options.uid is not None: context.uid = options.uid if options.gid is not None: co... | def main(): """ Start the socket server. """ parser = OptionParser() parser.add_option("-c", "--config", dest="config_file", help="Read configuration from FILE. (CLI options override config file.)", metavar="FILE") parser.add_option("-b", "--host", dest="listen_addr", help="Listen on specified address (default 0.0.0.... |
logger().info("Stomp server listening on %s:%s" % server.server_address) server.serve_forever() | main() | def main(): """ Start the socket server. """ parser = OptionParser() parser.add_option("-c", "--config", dest="config_file", help="Read configuration from FILE. (CLI options override config file.)", metavar="FILE") parser.add_option("-b", "--host", dest="listen_addr", help="Listen on specified address (default 0.0.0.... |
logger().error("Caught an exception in server: %s" % e) logger().exception(e) finally: server.server_close() if __name__ == '__main__': main() | logger().error("Server terminated due to error: %s" % e) logger().exception(e) | def main(): """ Start the socket server. """ parser = OptionParser() parser.add_option("-c", "--config", dest="config_file", help="Read configuration from FILE. (CLI options override config file.)", metavar="FILE") parser.add_option("-b", "--host", dest="listen_addr", help="Listen on specified address (default 0.0.0.... |
authenticator_factory = resolve_name(config.get('coilmq', 'authenticator_factory')) | authenticator_factory = resolve_name(config.get('coilmq', 'auth.factory')) | def server_from_config(config=None, server_class=None, additional_kwargs=None): """ Gets a configured L{coilmq.server.StompServer} from specified config. If `config` is None, global L{coilmq.config.config} var will be used instead. The `server_class` and `additional_kwargs` are primarily hooks for using this method f... |
while True: data = self.request.recv(8192) if not data: break if self.debug: self.log.debug("RECV: %r" % data) self.buffer.append(data) for frame in self.buffer: self.log.debug("Processing frame: %s" % frame) self.engine.process_frame(frame) | while not self.server._shutdown_request_event.is_set(): try: data = self.request.recv(8192) if not data: break if self.debug: self.log.debug("RECV: %r" % data) self.buffer.append(data) for frame in self.buffer: self.log.debug("Processing frame: %s" % frame) self.engine.process_frame(frame) except socket.timeout: pass | def handle(self): """ Handle a new socket connection. """ # self.request is the TCP socket connected to the client try: while True: data = self.request.recv(8192) if not data: break if self.debug: self.log.debug("RECV: %r" % data) self.buffer.append(data) for frame in self.buffer: self.log.debug("Processing frame: %s"... |
def __init__(self, server_address, RequestHandlerClass=None, authenticator=None, queue_manager=None, topic_manager=None): | def __init__(self, server_address, RequestHandlerClass=None, timeout=3.0, authenticator=None, queue_manager=None, topic_manager=None): | def __init__(self, server_address, RequestHandlerClass=None, authenticator=None, queue_manager=None, topic_manager=None): """ Extension to C{TCPServer} constructor to provide mechanism for providing implementation classes. @keyword authenticator: The configure L{coilmq.auth.Authenticator} object to use. @keyword queue... |
engine = engine_from_config(configuration, 'qstore.sa.') | engine = engine_from_config(configuration, 'qstore.sqlalchemy.') | def make_sa(): """ Factory to creates a SQLAlchemy queue store, pulling config values from the CoilMQ configuration. """ configuration = dict(config.items('coilmq')) engine = engine_from_config(configuration, 'qstore.sa.') init_model(engine) store = SAQueue() return store |
enumerated = self.callbacks["get_opt"]("tags_enumerated") == "True" | enumerated = self.callbacks["get_opt"]("taglist.tags_enumerated") == "True" | def render_header(self, mwidth, pad): enumerated = self.callbacks["get_opt"]("tags_enumerated") == "True" header = self.tag + u"\n" if enumerated: curtags = self.callbacks["get_var"]("curtags") header = ("[%d] " % curtags.index(self)) + header |
pad.move(pad.getyx()[0], mwidth - postl) | pad.move(y, mwidth - postl) | def theme_print(pad, uni, mwidth, pre = "", post = ""): prel = theme_len(pre) postl = theme_len(post) y = pad.getyx()[0] theme_print_one(pad, pre, prel) width = (mwidth - prel) - postl if width <= 0: raise Exception("theme_print: NO ROOM!") r = theme_print_one(pad, uni, width) pad.clrtoeol() if post: pad.move(pad.... |
else: try: pad.move(y + 1, 0) except: pass | try: pad.move(y + 1, 0) except: pass | def theme_print(pad, uni, mwidth, pre = "", post = ""): prel = theme_len(pre) postl = theme_len(post) y = pad.getyx()[0] theme_print_one(pad, pre, prel) width = (mwidth - prel) - postl if width <= 0: raise Exception("theme_print: NO ROOM!") r = theme_print_one(pad, uni, width) pad.clrtoeol() if post: pad.move(pad.... |
self.callbacks["set_opt"](option, True) | self.callbacks["set_opt"](option, "True") | def _cfg_set_prompt(self, option, prompt): # Ensure the items are enumerated t = self.callbacks["get_opt"](option) self.callbacks["set_opt"](option, True) |
maxr = taglines - start tag.pad.overwrite(self.pad, start, 0, 0, 0,\ maxr - 1, self.width - 1) | maxr = min(taglines - start, self.height) try: tag.pad.overwrite(self.pad, start, 0, 0, 0,\ maxr - 1, self.width - 1) except Exception, e: log.error("Partial top overwrite exception! %s" % (e,)) log.error("particulars: start -> %d" % start) log.error(" maxr -> %d" % maxr) log.error(" width -> ... | def redraw(self): self.pad.erase() |
self.cached_enumerated = None | self.cached_state = {} | def __init__(self, tag, callbacks): # Note that Tag() is only given the top-level CantoCursesGui # callbacks as it shouldn't be doing input / refreshing # itself. |
if self.cached_render_return and enumerated == self.cached_enumerated: | state = { "enumerated" : enumerated, "mwidth" : mwidth, "idx_offset" : idx_offset} if self.cached_render_return and state == self.cached_state: | def refresh(self, mwidth, idx_offset): # First, determine if we need to update. |
self.cached_enumerated = enumerated | self.cached_state = state | def refresh(self, mwidth, idx_offset): # First, determine if we need to update. |
if self.cached_render_return: | enumerated = self.callbacks["get_tweakable"]("enumerated") if self.cached_render_return and enumerated == self.cached_enumerated: | def refresh(self, mwidth, idx_offset): # First, determine if we need to update. |
enumerated = self.callbacks["get_tweakable"]("enumerated") | def refresh(self, mwidth, idx_offset): # First, determine if we need to update. | |
self.max_offset = max(lines - (self.height - 1), 0) | self.max_offset = max((lines - 1) - (self.height - 1), 0) | def refresh(self): self.height, self.width = self.pad.getmaxyx() show_desc = self.callbacks["get_opt"]("reader.show_description") enum_links = self.callbacks["get_opt"]("reader.enumerate_links") |
@command_format("goto\s*(?P<selidx>)?\s*$") | def getforitems(self, value): return self.got_items | |
if "selidx_int" in kwargs: items = [self.item_by_idx(int(kwargs["selidx_int"]))] | if "selidx" in kwargs: items = [self.item_by_idx(int(kwargs["selidx"]))] | def goto(self, **kwargs): |
watchpats.append("Forcing node %s to be terminated" % node) | watchpats.append("Node %s will be fenced because termination was requested" % node) | def __call__(self, node): self.incr("calls") if len(self.CM.Env["nodes"]) < 2: return self.skipped() |
self.writemsg("DEBUG: %s" % add_lineno(s)) | self.writemsg("DEBUG: %s" % self.add_lineno(s)) | def debug(self,s): if user_prefs.get_debug(): self.writemsg("DEBUG: %s" % add_lineno(s)) |
self._create('''primitive ping-1 ocf:pacemaker:ping params host_list=%s name=connected op monitor interval=120s''' % os.uname()[1]) | self._create('''primitive ping-1 ocf:pacemaker:ping params host_list=%s name=connected debug=true op monitor interval=120s''' % os.uname()[1]) | def add_resources(self): # Group Resource r1 = self.NewIP() ip = self.NextIP() r2 = "r"+ip self._create('''primitive %s heartbeat::IPaddr params 1=%s/32 op monitor interval=5s''' % (r2, ip)) r3 = self.NewIP() self._create('''group group-1 %s %s %s''' % (r1, r2, r3)) |
common_warn("unrecognized CIB element %s" % c.tagName) | common_warn("unrecognized CIB element %s" % topnode.tagName) | def show_unrecognized_elems(doc): try: conf = doc.getElementsByTagName("configuration")[0] except: common_warn("CIB has no configuration element") return for topnode in conf.childNodes: if not is_element(topnode): continue if is_defaults(topnode): continue if not topnode.tagName in cib_topnodes: common_warn("unrecogniz... |
test = self.Environment.RandomGen.choice(self.Tests) | test = self.ClusterManager.Env.RandomGen.choice(self.Tests) | def run_loop(self): testcount=1 while testcount <= max: test = self.Environment.RandomGen.choice(self.Tests) if self.run_test(test, testcount): testcount += 1 |
self.log_mark("stop") | test.log_mark("stop") | def run_test(self, BadNews, test, testcount): nodechoice = self.Env.RandomNode() |
def verify2(self): | def semantic_check(self): | def verify2(self): ''' Test objects for sanity. This is about semantics. ''' rc = 0 for obj in self.obj_list: rc |= obj.check_sanity() return rc |
obj.node = node if not cib_factory.test_element(self,newnode) or \ not id_store.replace_xml(oldnode,newnode): obj.node = oldnode | self.node = newnode if not cib_factory.test_element(self,newnode): id_store.replace_xml(newnode,oldnode) self.node = oldnode | def update_element(self,newnode): 'Update ourselves from a doc node.' if not newnode: return False if not cib_factory.is_cib_sane(): return False oldnode = self.node if xml_cmp(oldnode,newnode): newnode.unlink() return True # the new and the old versions are equal obj.node = node if not cib_factory.test_element(self,ne... |
print numpy.min(n0q) print numpy.max(n0q) | def make_colorramp(): """ Make me a crude color ramp """ c = numpy.zeros((256,3), numpy.int) # Ramp blue for b in range(0,37): c[b,2] = 255 for b in range(37,77): c[b,2]= (77-b)*6 for b in range(160,196): c[b,2]= (b-160)*6 for b in range(196,256): c[b,2] = 254 # Ramp Green up for g in range(0,37): c[g,1] = g*6 for g i... | |
from plone.app.customerize import registration registration.templateViewRegistrationInfos = patch_templateViewRegistrationInfos | def patch_templateViewRegistrationInfos(regs, mangle=True): for reg in regs: if ITTWViewTemplate.providedBy(reg.factory): zptfile = None zcmlfile = None name = reg.name or reg.factory.name customized = reg.factory.getId() # TODO: can we get an absolute url? else: attr, pt = findViewletTemplate(reg.factory) if attr i... | |
client.click(xpath=u"//a[@id='themeeditor-logo.jpg']/dt") | client.click(jquery=u"('dt[id^=themeeditor-logo.jpg] a')[0]") | def test_customize_logo(self): client = self.wm client.click(id=u'user-name') # load customizer client.click(link=u'Site Setup') client.waits.forPageLoad(timeout=u'20000') client.click(link=u'Theme Editor') # go into advanced mode and customize based on the logo in the # non-active "plone_images" layer (Windmill doesn'... |
client.waits.forElement(timeout=u'', id=u'themeeditor-logo.jpg') client.click(xpath=u"//a[@id='themeeditor-logo.jpg']/dt") | client.waits.forElement(timeout=u'', jquery=u"('dt[id^=themeeditor-logo.jpg]')[0]") client.click(jquery=u"('dt[id^=themeeditor-logo.jpg] a')[0]") | def test_customize_logo(self): client = self.wm client.click(id=u'user-name') # load customizer client.click(link=u'Site Setup') client.waits.forPageLoad(timeout=u'20000') client.click(link=u'Theme Editor') # go into advanced mode and customize based on the logo in the # non-active "plone_images" layer (Windmill doesn'... |
self.write_browser_configure_zcml(output_dir,namespace_package,name,base_theme,version) | self.write_zcml_and_generic_setup(output_dir,namespace_package,name, base_theme,version) | def theme_populate(self,output_dir,namespace_package,name,make_jbot_zcml=0, dump_cmfskins=0,base_theme='Plone Default',version='100'): """ retreive all the customized items and export to the theme_skel """ # get all customized resources container = getUtility(IViewTemplateContainer) rm = getUtility(IResourceRetriever) ... |
def write_browser_configure_zcml(self,output_dir,namespace_package,name,base_theme,version): """ write a custom version of browser/configure.zcml """ package_name = "%s.%s" % (namespace_package,name) | def dump_cmfskins(self,output_dir,namespace_package,name,base_theme,version): """ convert resource to filesystem directory """ package_name = "%s.%s" % (namespace_package,name) zmi_skin_names = ['custom',] fs_dest_directory = output_dir | def write_browser_configure_zcml(self,output_dir,namespace_package,name,base_theme,version): """ write a custom version of browser/configure.zcml """ package_name = "%s.%s" % (namespace_package,name) fs_product_name = '%s.%s' % (namespace_package,name) skin_vars = {'name':name, 'namespace':namespace_package, 'package_n... |
_templates_dir = os.path.join(os.path.dirname(__file__)) template = os.path.join(_templates_dir,'browser_configure.zcml.tmpl') output_file = os.path.join(output_dir,package_name, namespace_package,name,'browser','configure.zcml') self.write_tmpl(template,output_file,vars=skin_vars) def dump_cmfskins(self,output_dir,na... | def write_browser_configure_zcml(self,output_dir,namespace_package,name,base_theme,version): """ write a custom version of browser/configure.zcml """ package_name = "%s.%s" % (namespace_package,name) fs_product_name = '%s.%s' % (namespace_package,name) skin_vars = {'name':name, 'namespace':namespace_package, 'package_n... | |
self.runner = tools.cmd2argv(os.path.abspath(__file__)) + \ sys.argv[1:] | if INSTALLED: self.runner = tools.cmd2argv( p.abspath(find_cmd('iptest'))) + sys.argv[1:] else: ippath = p.abspath(p.join(p.dirname(__file__),'..','..')) script = p.join(ippath, 'iptest.py') self.runner = tools.cmd2argv(script) + sys.argv[1:] | def __init__(self, runner='iptest', params=None): """Create new test runner.""" if runner == 'iptest': # Find our own 'iptest' script OS-level entry point. Don't look # system-wide, so we are sure we pick up *this one*. And pass # through to subprocess call our own sys.argv self.runner = tools.cmd2argv(os.path.abspat... |
self.runner = tools.cmd2argv(os.path.abspath(find_cmd('trial'))) | self.runner = tools.cmd2argv(p.abspath(find_cmd('trial'))) | def __init__(self, runner='iptest', params=None): """Create new test runner.""" if runner == 'iptest': # Find our own 'iptest' script OS-level entry point. Don't look # system-wide, so we are sure we pick up *this one*. And pass # through to subprocess call our own sys.argv self.runner = tools.cmd2argv(os.path.abspat... |
'--traverse-namespace', | def run_iptest(): """Run the IPython test suite using nose. This function is called when this script is **not** called with the form `iptest all`. It simply calls nose with appropriate command line flags and accepts all of the standard nose arguments. """ warnings.filterwarnings('ignore', 'This will be removed soon.... | |
argv = sys.argv + [ '--detailed-errors', | argv = sys.argv + [ '--detailed-errors', '--traverse-namespace', | def run_iptest(): """Run the IPython test suite using nose. This function is called when this script is **not** called with the form `iptest all`. It simply calls nose with appropriate command line flags and accepts all of the standard nose arguments. """ warnings.filterwarnings('ignore', 'This will be removed soon.... |
exclusions.append(ipjoin('scripts', 'irunner')) | exclusions.extend([ipjoin('scripts', 'irunner'), ipjoin('lib', 'irunner')]) | def make_exclude(): """Make patterns of modules and packages to exclude from testing. For the IPythonDoctest plugin, we need to exclude certain patterns that cause testing problems. We should strive to minimize the number of skipped modules, since this means untested code. As the testing machinery solidifies, this l... |
except ImportError: | except (ImportError, RuntimeError): | def test_for(mod): """Test to see if mod is importable.""" try: __import__(mod) except ImportError: return False else: return True |
exclusions = [pjoin('IPython', 'external'), pjoin('IPython', 'frontend', 'process', 'winprocess.py'), | ipjoin = lambda *paths: pjoin('IPython', *paths) exclusions = [ipjoin('external'), ipjoin('frontend', 'process', 'winprocess.py'), | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
pjoin('IPython', 'quarantine'), pjoin('IPython', 'deathrow'), pjoin('IPython', 'testing', 'attic'), pjoin('IPython', 'testing', 'tools'), pjoin('IPython', 'testing', 'mkdoctests'), pjoin('IPython', 'lib', 'inputhook'), | ipjoin('quarantine'), ipjoin('deathrow'), ipjoin('testing', 'attic'), ipjoin('testing', 'tools'), ipjoin('testing', 'mkdoctests'), ipjoin('lib', 'inputhook'), | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
pjoin('IPython', 'config', 'default'), pjoin('IPython', 'config', 'profile'), | ipjoin('config', 'default'), ipjoin('config', 'profile'), | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
exclusions.append(pjoin('IPython', 'gui')) exclusions.append(pjoin('IPython', 'frontend', 'wx')) exclusions.append(pjoin('IPython', 'lib', 'inputhookwx')) | exclusions.append(ipjoin('gui')) exclusions.append(ipjoin('frontend', 'wx')) exclusions.append(ipjoin('lib', 'inputhookwx')) | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
exclusions.append(pjoin('IPython', 'lib', 'inputhookgtk')) | exclusions.append(ipjoin('lib', 'inputhookgtk')) | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
exclusions.append(pjoin('IPython', 'gui', 'wx', 'wxIPython')) | exclusions.append(ipjoin('gui', 'wx', 'wxIPython')) | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
exclusions.append(pjoin('IPython', 'frontend', 'cocoa')) | exclusions.append(ipjoin('frontend', 'cocoa')) | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
exclusions.append(pjoin('IPython', 'utils', 'platutils_win32')) | exclusions.append(ipjoin('utils', 'platutils_win32')) | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
exclusions.append(pjoin('IPython', 'testing', 'plugin', 'test_exampleip')) exclusions.append(pjoin('IPython', 'testing', 'plugin', 'dtexample')) | exclusions.append(ipjoin('testing', 'plugin', 'test_exampleip')) exclusions.append(ipjoin('testing', 'plugin', 'dtexample')) | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
exclusions.append(pjoin('IPython', 'utils', 'platutils_posix')) | exclusions.append(ipjoin('utils', 'platutils_posix')) | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
exclusions.append(pjoin('IPython', 'scripts', 'irunner')) | exclusions.append(ipjoin('scripts', 'irunner')) | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
exclusions.append(pjoin('IPython', 'frontend', 'asyncfrontendbase')) exclusions.append(pjoin('IPython', 'frontend', 'prefilterfrontend')) exclusions.append(pjoin('IPython', 'frontend', 'frontendbase')) exclusions.append(pjoin('IPython', 'frontend', 'linefrontendbase')) exclusions.append(pjoin('IPython', 'frontend', 'te... | exclusions.extend( [ipjoin('frontend', 'asyncfrontendbase'), ipjoin('frontend', 'prefilterfrontend'), ipjoin('frontend', 'frontendbase'), ipjoin('frontend', 'linefrontendbase'), ipjoin('frontend', 'tests', 'test_linefrontend'), ipjoin('frontend', 'tests', 'test_frontendbase'), ipjoin('frontend', 'tests', 'test_prefilte... | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # These modules and pa... |
class IPTester(object): """Call that calls iptest or trial in a subprocess. """ def __init__(self,runner='iptest',params=None): """ """ if runner == 'iptest': self.runner = ['iptest','-v'] else: self.runner = [find_cmd('trial')] if params is None: params = [] if isinstance(params,str): params = [params] self.params = p... | def run_iptest(): """Run the IPython test suite using nose. This function is called when this script is **not** called with the form `iptest all`. It simply calls nose with appropriate command line flags and accepts all of the standard nose arguments. """ warnings.filterwarnings('ignore', 'This will be removed soon.... | |
for name,runner in runners.iteritems(): print '*'*77 print 'IPython test group:',name res = runner.run() if res: failed[name] = res | try: for name,runner in runners.iteritems(): print '*'*77 print 'IPython test group:',name res = runner.run() if res: failed[name] = res finally: os.chdir(curdir) | def run_iptestall(): """Run the entire IPython test suite by calling nose and trial. This function constructs :class:`IPTester` instances for all IPython modules and package and then runs each of them. This causes the modules and packages of IPython to be tested each in their own subprocess using nose or twisted.tria... |
try: iptest_path = os.path.abspath(find_cmd('iptest')) except FindCmdError: pak_dir = os.path.abspath(genutils.get_ipython_package_dir()) iptest_path = pjoin(pak_dir, 'scripts', 'iptest') self.runner = tools.cmd2argv(iptest_path) + ['-v'] | self.runner = tools.cmd2argv(__file__) + sys.argv[1:] | def __init__(self,runner='iptest',params=None): """Create new test runner.""" if runner == 'iptest': # Find our own 'iptest' script OS-level entry point try: iptest_path = os.path.abspath(find_cmd('iptest')) except FindCmdError: # Script not installed (may be the case for testing situations # that are running from a so... |
runners = dict(zip(nose_packages, nose_testers)) | runners = zip(nose_packages, nose_testers) | def make_runners(): """Define the top-level packages that need to be tested. """ nose_packages = ['config', 'core', 'extensions', 'frontend', 'lib', 'scripts', 'testing', 'utils', # Note that we list the kernel here, though the bulk of it # is twisted-based, because nose picks up doctests that # twisted doesn't. 'kern... |
trial_testers = [IPTester('trial',params=v) for v in trial_packages] runners.update(dict(zip(trial_packages,trial_testers))) | trial_testers = [IPTester('trial', params=v) for v in trial_packages] runners.extend(zip(trial_packages, trial_testers)) | def make_runners(): """Define the top-level packages that need to be tested. """ nose_packages = ['config', 'core', 'extensions', 'frontend', 'lib', 'scripts', 'testing', 'utils', # Note that we list the kernel here, though the bulk of it # is twisted-based, because nose picks up doctests that # twisted doesn't. 'kern... |
has_tests = False for arg in sys.argv: if 'IPython' in arg or arg.endswith('.py') or \ (':' in arg and '.py' in arg): has_tests = True break if not has_tests: argv.append('IPython') | def run_iptest(): """Run the IPython test suite using nose. This function is called when this script is **not** called with the form `iptest all`. It simply calls nose with appropriate command line flags and accepts all of the standard nose arguments. """ warnings.filterwarnings('ignore', 'This will be removed soon.... | |
failed = {} | failed = [] | def run_iptestall(): """Run the entire IPython test suite by calling nose and trial. This function constructs :class:`IPTester` instances for all IPython modules and package and then runs each of them. This causes the modules and packages of IPython to be tested each in their own subprocess using nose or twisted.tria... |
for name,runner in runners.iteritems(): print '*'*77 | for (name, runner) in runners: print '*'*70 | def run_iptestall(): """Run the entire IPython test suite by calling nose and trial. This function constructs :class:`IPTester` instances for all IPython modules and package and then runs each of them. This causes the modules and packages of IPython to be tested each in their own subprocess using nose or twisted.tria... |
failed[name] = res | failed.append( (name, runner) ) | def run_iptestall(): """Run the entire IPython test suite by calling nose and trial. This function constructs :class:`IPTester` instances for all IPython modules and package and then runs each of them. This causes the modules and packages of IPython to be tested each in their own subprocess using nose or twisted.tria... |
print '*'*77 | print '*'*70 | def run_iptestall(): """Run the entire IPython test suite by calling nose and trial. This function constructs :class:`IPTester` instances for all IPython modules and package and then runs each of them. This causes the modules and packages of IPython to be tested each in their own subprocess using nose or twisted.tria... |
for name in failed: failed_runner = runners[name] | for name, failed_runner in failed: | def run_iptestall(): """Run the entire IPython test suite by calling nose and trial. This function constructs :class:`IPTester` instances for all IPython modules and package and then runs each of them. This causes the modules and packages of IPython to be tested each in their own subprocess using nose or twisted.tria... |
if len(sys.argv) == 1: | for arg in sys.argv[1:]: if arg.startswith('IPython'): run_iptest() else: | def main(): if len(sys.argv) == 1: run_iptestall() else: if sys.argv[1] == 'all': run_iptestall() else: run_iptest() |
else: if sys.argv[1] == 'all': run_iptestall() else: run_iptest() | def main(): if len(sys.argv) == 1: run_iptestall() else: if sys.argv[1] == 'all': run_iptestall() else: run_iptest() | |
pjoin('IPython', 'frontend', 'process', 'winprocess.py'), pjoin('IPython_doctest_plugin'), pjoin('IPython', 'quarantine'), pjoin('IPython', 'deathrow'), pjoin('IPython', 'testing', 'attic'), pjoin('IPython', 'testing', 'tools'), pjoin('IPython', 'testing', 'mkdoctests'), pjoin('IPython', 'lib', 'inputhook') ] | pjoin('IPython', 'frontend', 'process', 'winprocess.py'), pjoin('IPython_doctest_plugin'), pjoin('IPython', 'quarantine'), pjoin('IPython', 'deathrow'), pjoin('IPython', 'testing', 'attic'), pjoin('IPython', 'testing', 'tools'), pjoin('IPython', 'testing', 'mkdoctests'), pjoin('IPython', 'lib', 'inputhook'), pjoin('IP... | def make_exclude(): # For the IPythonDoctest plugin, we need to exclude certain patterns that # cause testing problems. We should strive to minimize the number of # skipped modules, since this means untested code. As the testing # machinery solidifies, this list should eventually become empty. # Note that these exc... |
nose_packages = ['config', 'core', 'extensions', 'frontend', 'lib', 'scripts', 'testing', 'utils', 'kernel'] | nose_pkg_names = ['config', 'core', 'extensions', 'frontend', 'lib', 'scripts', 'testing', 'utils' ] | def make_runners(): """Define the top-level packages that need to be tested. """ nose_packages = ['config', 'core', 'extensions', 'frontend', 'lib', 'scripts', 'testing', 'utils', # Note that we list the kernel here, though the bulk of it # is twisted-based, because nose picks up doctests that # twisted doesn't. 'kern... |
trial_packages = ['kernel'] | trial_pkg_names = [] | def make_runners(): """Define the top-level packages that need to be tested. """ nose_packages = ['config', 'core', 'extensions', 'frontend', 'lib', 'scripts', 'testing', 'utils', # Note that we list the kernel here, though the bulk of it # is twisted-based, because nose picks up doctests that # twisted doesn't. 'kern... |
nose_packages.append('gui') nose_packages = ['IPython.%s' % m for m in nose_packages ] trial_packages = ['IPython.%s' % m for m in trial_packages ] nose_testers = [IPTester(params=v) for v in nose_packages] runners = zip(nose_packages, nose_testers) | nose_pkg_names.append('gui') | def make_runners(): """Define the top-level packages that need to be tested. """ nose_packages = ['config', 'core', 'extensions', 'frontend', 'lib', 'scripts', 'testing', 'utils', # Note that we list the kernel here, though the bulk of it # is twisted-based, because nose picks up doctests that # twisted doesn't. 'kern... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.