rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
if line[0] == "!": if pos[-1] != last_file: last_file = pos[-1] self.msg(0, _("in file %s:") % last_file) self.msg(0, line) showing = 1 something = 1 | m = re_badbox.match(line) if m: skipping = 1 | def show_errors (self): """ Display all errors that occured during compilation. Return 0 if there was no error. """ pos = ["(no file)"] last_file = None showing = 0 something = 0 for line in self.lines: line = line.rstrip() if line == "": continue if showing: self.msg(0, line) if line[0:2] == "l." or line[0:3] == "***": showing = 0 else: self.update_file(line, pos) else: if line[0] == "!": if pos[-1] != last_file: last_file = pos[-1] self.msg(0, _("in file %s:") % last_file) self.msg(0, line) showing = 1 something = 1 else: self.update_file(line, pos) return something | 06136d32eb3d7a9f7532309eb3c07224eb27e52d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/06136d32eb3d7a9f7532309eb3c07224eb27e52d/__init__.py |
msg.warn(_("dependency '%s' not found") % arg, **pos) | msg.warn(_("dependency '%s' not found") % arg, **self.vars) | def do_depend (self, *args): for arg in args: file = self.env.find_file(arg) if file: self.sources[file] = DependLeaf(self.env, file) else: msg.warn(_("dependency '%s' not found") % arg, **pos) | 4d02e3980db32c158761e3f289ae72cc4f79c77a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/4d02e3980db32c158761e3f289ae72cc4f79c77a/__init__.py |
return 0 if self.undef_cites != new: | elif self.undef_cites != new: | def bibtex_needed (self): """ Return true if BibTeX must be run. """ if self.run_needed: return 1 self.msg(2, _("checking if BibTeX must be run...")) | 7e57cdea587b20eb3a5d8f354d5b1ae0aa82a95c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/7e57cdea587b20eb3a5d8f354d5b1ae0aa82a95c/bibtex.py |
self.msg(2, _("the undefined citations are the same")) return 0 self.undef_cites = self.list_undefs() | else: self.msg(2, _("the undefined citations are the same")) else: self.undef_cites = self.list_undefs() | def bibtex_needed (self): """ Return true if BibTeX must be run. """ if self.run_needed: return 1 self.msg(2, _("checking if BibTeX must be run...")) | 7e57cdea587b20eb3a5d8f354d5b1ae0aa82a95c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/7e57cdea587b20eb3a5d8f354d5b1ae0aa82a95c/bibtex.py |
penv = posix.environ | penv = posix.environ.copy() | def execute (self, prog, env={}): """ Silently execute an external program. The `prog' argument is the list of arguments for the program, `prog[0]' is the program name. The `env' argument is a dictionary with definitions that should be added to the environment when running the program. The output is dicarded, but messages from Kpathsea are processed (to indicate e.g. font compilation). """ self.msg(1, _("executing: %s") % string.join(prog)) if env != {}: self.msg(2, _("with environment: %r") % env) | eac1fdd224c8252740b90106e021d56919bdcd6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/eac1fdd224c8252740b90106e021d56919bdcd6f/__init__.py |
for line in file.readlines(): | for line in fd.readlines(): | def include (self, source, list): """ This function tries to find a specified MetaPost source (currently all in the same directory), appends its actual name to the list, and parses it to find recursively included files. """ if exists(source + ".mp"): file = source + ".mp" elif exists(source): file = source else: return list.append(file) fd = open(file) for line in file.readlines(): m = re_input.search(line) if m: self.include(m["file"]) fd.close() | bb2c5f8d6023e7f7c3b66f95582037a9116b959c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/bb2c5f8d6023e7f7c3b66f95582037a9116b959c/mpost.py |
self.include(m["file"]) | self.include(m.group("file"), list) | def include (self, source, list): """ This function tries to find a specified MetaPost source (currently all in the same directory), appends its actual name to the list, and parses it to find recursively included files. """ if exists(source + ".mp"): file = source + ".mp" elif exists(source): file = source else: return list.append(file) fd = open(file) for line in file.readlines(): m = re_input.search(line) if m: self.include(m["file"]) fd.close() | bb2c5f8d6023e7f7c3b66f95582037a9116b959c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/bb2c5f8d6023e7f7c3b66f95582037a9116b959c/mpost.py |
if string.strip(code) != "": | if code: | def error (self, file, line, text, code): """ This method is called when the parsing of the log file found an error. The arguments are, respectively, the name of the file and the line number where the error occurred, the description of the error, and the offending code (up to the error). """ self.write(0, _("\nline %d in %s:\n %s") % (line, file, text)) if string.strip(code) != "": self.write(0, " --> " + code) | 8e9ac1ee8744c536f57233505c28e35aac3eb48d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/8e9ac1ee8744c536f57233505c28e35aac3eb48d/__init__.py |
re_line = re.compile("l\\.(?P<line>[0-9]+) ") | re_line = re.compile("l\\.(?P<line>[0-9]+)( (?P<text>.*))?$") | def register (self, name, dict={}): """ Attempt to register a package with the specified name. If a module is found, create an object from the module's class called `Module', passing it the environment and `dict' as arguments. This dictionary describes the command that caused the registration. """ r = self.load_module(name, "rubber.modules") if r == 0: self.env.msg(3, _("no support found for %s") % name) return 1 elif r == 2: self.env.msg(3, _("module %s already registered") % name) return 1 mod = self.modules[name].Module(self.env, dict) self.env.msg(2, _("module %s registered") % name) self.objects[name] = mod return 0 | 8e9ac1ee8744c536f57233505c28e35aac3eb48d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/8e9ac1ee8744c536f57233505c28e35aac3eb48d/__init__.py |
error, line[m.end():]) | error, m.group("text")) | def show_errors (self): """ Display all errors that occured during compilation. Return 0 if there was no error. """ pos = ["(no file)"] last_file = None parsing = 0 # 1 if we are parsing an error's text skipping = 0 # 1 if we are skipping text until an empty line something = 0 # 1 if some error was found for line in self.lines: line = line.rstrip() if line == "": skipping = 0 elif skipping: pass elif parsing: m = re_line.match(line) if m: parsing = 0 skipping = 1 self.msg.error(pos[-1], int(m.group("line")), error, line[m.end():]) elif line[0:3] == "***": parsing = 0 skipping = 1 self.msg.abort(error, line[4:]) elif line[0] == "!": error = line[2:] parsing = 1 something = 1 else: # Here there is no error to show, so we use the text of the # line to track the source file name. However, there might be # confusing text in the log file, in particular when there is # an overfull/underfull box message (the text following this # is extracted from the source, and the extract may contain # unbalanced parentheses). Therefore we take care of this # specifically. | 8e9ac1ee8744c536f57233505c28e35aac3eb48d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/8e9ac1ee8744c536f57233505c28e35aac3eb48d/__init__.py |
self.base = target[:-3] | self.base = source[:-3] | def __init__ (self, target, source, env): leaf = DependLeaf([source]) Depend.__init__(self, [target], {source: leaf}) self.env = env self.base = target[:-3] self.cmd = ["mpost", "--interaction=batchmode", self.base] | 265b1416eb5921a97e6156c7f3c61de95e7a16cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/265b1416eb5921a97e6156c7f3c61de95e7a16cf/mpost.py |
pos = [] | pos = ["(no file)"] | def show_boxes (self): """ Display all messages related so underfull and overfull boxes. Return 0 if there is nothing to display. """ pos = [] page = 1 something = 0 for line in self.lines: line = line.rstrip() if re_hvbox.match(line): self.msg.info({"file":pos[-1], "page":page}, line) something = 1 else: self.update_file(line, pos) page = self.update_page(line, page) return something | ce3b58fe3aba60eaa53233278856d049a7043861 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/ce3b58fe3aba60eaa53233278856d049a7043861/info.py |
if re_hvbox.match(line): | if skip: if line == "": skip = 0 elif re_hvbox.match(line): | def show_boxes (self): """ Display all messages related so underfull and overfull boxes. Return 0 if there is nothing to display. """ pos = [] page = 1 something = 0 for line in self.lines: line = line.rstrip() if re_hvbox.match(line): self.msg.info({"file":pos[-1], "page":page}, line) something = 1 else: self.update_file(line, pos) page = self.update_page(line, page) return something | ce3b58fe3aba60eaa53233278856d049a7043861 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/ce3b58fe3aba60eaa53233278856d049a7043861/info.py |
pos = [] | pos = ["(no file)"] | def show_warnings (self): """ Display all warnings. This function is pathetically dumb, as it simply shows all lines in the log that contain the substring 'Warning'. """ pos = [] page = 1 something = 0 for line in self.lines: if line.find("Warning") != -1: self.msg.info( {"file":pos[-1], "page":page}, string.rstrip(line)) something = 1 else: self.update_file(line, pos) page = self.update_page(line, page) return something | ce3b58fe3aba60eaa53233278856d049a7043861 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/ce3b58fe3aba60eaa53233278856d049a7043861/info.py |
if line.find("Warning") != -1: | if skip: if line == "": skip = 0 elif re_hvbox.match(line): skip = 1 elif line.find("Warning") != -1: | def show_warnings (self): """ Display all warnings. This function is pathetically dumb, as it simply shows all lines in the log that contain the substring 'Warning'. """ pos = [] page = 1 something = 0 for line in self.lines: if line.find("Warning") != -1: self.msg.info( {"file":pos[-1], "page":page}, string.rstrip(line)) something = 1 else: self.update_file(line, pos) page = self.update_page(line, page) return something | ce3b58fe3aba60eaa53233278856d049a7043861 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/ce3b58fe3aba60eaa53233278856d049a7043861/info.py |
penv = posix.environ | penv = posix.environ.copy() | def execute (self, prog, env={}): """ Silently execute an external program. The `prog' argument is the list of arguments for the program, `prog[0]' is the program name. The `env' argument is a dictionary with definitions that should be added to the environment when running the program. The output is dicarded, but messages from Kpathsea are processed (to indicate e.g. font compilation). """ self.msg(1, _("executing: %s") % string.join(prog)) if env != {}: self.msg(2, _("with environment: %r") % env) | 1d1e1046f416423b535a4cc40006020f5b16f69a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/1d1e1046f416423b535a4cc40006020f5b16f69a/__init__.py |
self.cmd_t = ["fig2dev", "-L", lang + "_t", "-p", epsname, fig, tex ] | self.cmd_t = ["fig2dev", "-L", lang + "_t", "-p", os.path.basename(epsname), fig, tex ] | def __init__ (self, env, tex, fig, vars, module=None, loc={}): """ The arguments of the constructor are, respectively, the figure's source, the LaTeX source produced, the EPS figure produced, the name to use for it (probably the same one), and the environment. """ leaf = DependLeaf(env, fig, loc=loc) self.env = env | 76172ff034c69a9b3e7138ebbda8edae9693d568 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/76172ff034c69a9b3e7138ebbda8edae9693d568/fig2dev.py |
file, path, descr = imp.find_module(join(pname, name)); | file, path, descr = imp.find_module(os.path.join(pname, name)); | def load_module (self, name, package=None): """ Attempt to register a module with the specified name. If an appropriate module is found, load it and store it in the object's dictionary. Return 0 if no module was found, 1 if a module was found and loaded, and 2 if the module was found but already loaded. """ if self.modules.has_key(name): return 2 try: file, path, descr = imp.find_module(name, [""]) except ImportError: if not package: return 0 try: pname = "" for p in package.split("."): pname = os.path.join(pname, p) file, path, descr = imp.find_module(join(pname, name)); except ImportError: return 0 module = imp.load_module(name, file, path, descr) file.close() self.modules[name] = module return 1 | f0aadf17dcc79b98534849f9b95ebd3856511da5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/f0aadf17dcc79b98534849f9b95ebd3856511da5/util.py |
self.path = [""] if doc.src_path != "" and doc.src_path != ".": self.path.append(doc.src_path) self.style = None | self.tool = "makeindex" self.lang = None self.modules = [] | def __init__ (self, doc, source, target, transcript): """ Initialize the index, by specifying the source file (generated by LaTeX), the target file (the output of makeindex) and the transcript (e.g. .ilg) file. Transcript is used by glosstex.py. """ self.doc = doc self.pbase = doc.src_base self.source = doc.src_base + "." + source self.target = doc.src_base + "." + target self.transcript = doc.src_base + "." + transcript if os.path.exists(self.source): self.md5 = md5_file(self.source) else: self.md5 = None | 7a514983a94234b974ae6e03aa438571b99b14e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/7a514983a94234b974ae6e03aa438571b99b14e3/index.py |
cmd = ["makeindex", "-o", self.target] + self.opts cmd.extend(["-t", self.transcript]) if self.style: cmd.extend(["-s", self.style]) cmd.append(self.pbase) if self.path != [""]: env = { 'INDEXSTYLE': string.join(self.path + [os.getenv("INDEXSTYLE", "")], ":") } | if self.tool == "makeindex": cmd = ["makeindex", "-o", self.target] + self.opts cmd.extend(["-t", self.transcript]) if self.style: cmd.extend(["-s", self.style]) cmd.append(self.pbase) path_var = "INDEXSTYLE" elif self.tool == "xindy": cmd = ["texindy", "--quiet"] for opt in self.opts: if opt == "-g": if self.lang != "": msg.warn(_("'language' overrides 'order german'"), pkg="index") else: self.lang = "german-din" elif opt == "-l": self.modules.append("letter-ordering") msg.warn(_("use 'module letter-ordering' instead of 'order letter'"), pkg="index") else: msg.error("unknown option to xindy: %s" % opt, pkg="index") for mod in self.modules: cmd.extend(["--module", mod]) if self.lang: cmd.extend(["--language", self.lang]) cmd.append(self.source) path_var = "XINDY_SEARCHPATH" if self.path != []: env = { path_var: string.join(self.path + [os.getenv(path_var, "")], ":") } | def post_compile (self): """ Run makeindex if needed, with appropriate options and environment. """ if not os.path.exists(self.source): msg.log(_("strange, there is no %s") % self.source, pkg="index") return 0 if not self.run_needed(): return 0 | 7a514983a94234b974ae6e03aa438571b99b14e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/7a514983a94234b974ae6e03aa438571b99b14e3/index.py |
msg.error(_("makeindex failed on %s") % self.source) | msg.error(_("could not make index %s") % self.target) | def post_compile (self): """ Run makeindex if needed, with appropriate options and environment. """ if not os.path.exists(self.source): msg.log(_("strange, there is no %s") % self.source, pkg="index") return 0 if not self.run_needed(): return 0 | 7a514983a94234b974ae6e03aa438571b99b14e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/7a514983a94234b974ae6e03aa438571b99b14e3/index.py |
self.indices["default"] = Index(self.doc, "idx", "ind", "ilg") | self.register("default", "idx", "ind", "ilg") | def makeindex (self, dict): """ Register the standard index. """ self.indices["default"] = Index(self.doc, "idx", "ind", "ilg") | 7a514983a94234b974ae6e03aa438571b99b14e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/7a514983a94234b974ae6e03aa438571b99b14e3/index.py |
self.indices[index] = Index(self.doc, d["idx"], d["ind"], "ilg") | self.register(index, d["idx"], d["ind"], "ilg") | def newindex (self, dict): """ Register a new index. """ m = re_newindex.match(dict["line"]) if not m: return index = dict["arg"] d = m.groupdict() self.indices[index] = Index(self.doc, d["idx"], d["ind"], "ilg") msg.log(_("index %s registered") % index, pkg="index") | 7a514983a94234b974ae6e03aa438571b99b14e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/7a514983a94234b974ae6e03aa438571b99b14e3/index.py |
for index in m.group("list").split(","): if indices.has_key(index): indices[index].command(cmd, args[1:]) else: for index in indices.values(): index.command(cmd, args) | names = m.group("list").split(",") args = args[1:] if names is None: self.defaults.append([cmd, args]) names = indices.keys() for index in names: if indices.has_key(index): indices[index].command(cmd, args[1:]) elif self.commands.has_key(index): self.commands[index].append([cmd, args]) else: self.commands[index] = [[cmd, args]] | def command (self, cmd, args): indices = self.indices if len(args) > 0: m = re_optarg.match(args[0]) if m: for index in m.group("list").split(","): if indices.has_key(index): indices[index].command(cmd, args[1:]) else: for index in indices.values(): index.command(cmd, args) | 7a514983a94234b974ae6e03aa438571b99b14e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/7a514983a94234b974ae6e03aa438571b99b14e3/index.py |
if self.env.may_produce(source): | if exists(target) and self.env.may_produce(source): | def check (source, target, suffixes=suffixes): if self.env.may_produce(source): return 0 if suffixes == [""]: return 1 for suffix in suffixes: if source[-len(suffix):] == suffix: return 0 return 1 | e27b1b814f7545561699b5a64e48c6dabb7ff4d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/e27b1b814f7545561699b5a64e48c6dabb7ff4d0/graphics.py |
pos = [] | pos = ["(no file)"] | def show_boxes (self): """ Display all messages related so underfull and overfull boxes. Return 0 if there is nothing to display. """ pos = [] page = 1 something = 0 for line in self.lines: line = line.rstrip() if re_hvbox.match(line): self.msg.info({"file":pos[-1], "page":page}, line) something = 1 else: self.update_file(line, pos) page = self.update_page(line, page) return something | cbfab9ecb8c46c820b46bba94da63e7b7c0895ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/cbfab9ecb8c46c820b46bba94da63e7b7c0895ca/info.py |
if re_hvbox.match(line): | if skip: if line == "": skip = 0 elif re_hvbox.match(line): | def show_boxes (self): """ Display all messages related so underfull and overfull boxes. Return 0 if there is nothing to display. """ pos = [] page = 1 something = 0 for line in self.lines: line = line.rstrip() if re_hvbox.match(line): self.msg.info({"file":pos[-1], "page":page}, line) something = 1 else: self.update_file(line, pos) page = self.update_page(line, page) return something | cbfab9ecb8c46c820b46bba94da63e7b7c0895ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/cbfab9ecb8c46c820b46bba94da63e7b7c0895ca/info.py |
pos = [] | pos = ["(no file)"] | def show_warnings (self): """ Display all warnings. This function is pathetically dumb, as it simply shows all lines in the log that contain the substring 'Warning'. """ pos = [] page = 1 something = 0 for line in self.lines: if line.find("Warning") != -1: self.msg.info( {"file":pos[-1], "page":page}, string.rstrip(line)) something = 1 else: self.update_file(line, pos) page = self.update_page(line, page) return something | cbfab9ecb8c46c820b46bba94da63e7b7c0895ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/cbfab9ecb8c46c820b46bba94da63e7b7c0895ca/info.py |
if line.find("Warning") != -1: | if skip: if line == "": skip = 0 elif re_hvbox.match(line): skip = 1 elif line.find("Warning") != -1: | def show_warnings (self): """ Display all warnings. This function is pathetically dumb, as it simply shows all lines in the log that contain the substring 'Warning'. """ pos = [] page = 1 something = 0 for line in self.lines: if line.find("Warning") != -1: self.msg.info( {"file":pos[-1], "page":page}, string.rstrip(line)) something = 1 else: self.update_file(line, pos) page = self.update_page(line, page) return something | cbfab9ecb8c46c820b46bba94da63e7b7c0895ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/cbfab9ecb8c46c820b46bba94da63e7b7c0895ca/info.py |
return None, None | def do_watch (self, *args): for arg in args: self.watch_file(arg) | b3ede1135bc8337fd369df8baab610bdc1764b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/b3ede1135bc8337fd369df8baab610bdc1764b4b/__init__.py |
|
self.failed_dep = mod | self.failed_module = mod | def pre_compile (self): """ Prepare the source for compilation using package-specific functions. This function must return true on failure. This function sets `must_compile' to 1 if we already know that a compilation is needed, because it may avoid some unnecessary preprocessing (e.g. BibTeXing). """ if os.path.exists(self.src_base + ".aux"): self.aux_md5 = md5_file(self.src_base + ".aux") else: self.aux_md5 = None self.aux_md5_old = None | b3ede1135bc8337fd369df8baab610bdc1764b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/b3ede1135bc8337fd369df8baab610bdc1764b4b/__init__.py |
self.failed_dep = mod | self.failed_module = mod | def post_compile (self): """ Run the package-specific operations that are to be performed after each compilation of the main source. Returns true on failure. """ msg.log(_("running post-compilation scripts...")) | b3ede1135bc8337fd369df8baab610bdc1764b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/b3ede1135bc8337fd369df8baab610bdc1764b4b/__init__.py |
self.log.show_errors() | if self.failed_module is None: self.log.show_errors() else: self.failed_module.show_errors() | def show_errors (self): self.log.show_errors() | b3ede1135bc8337fd369df8baab610bdc1764b4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/b3ede1135bc8337fd369df8baab610bdc1764b4b/__init__.py |
env.add_hook("listinginput", self.input) | env.add_hook("listinginput", self.listinginput) | def __init__ (self, env, dict): self.env = env env.add_hook("verbatimtabinput", self.input) env.add_hook("listinginput", self.input) | 3b129f0ee77beb51be348343c6e731c61c5191ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/3b129f0ee77beb51be348343c6e731c61c5191ca/moreverb.py |
bbl = env.src_base + ".bbl" | def __init__ (self, env, dict): """ Initialize the state of the module and register appropriate functions in the main process. """ self.env = env self.msg = env.msg | 9c5450cdf085e5012e7ba2134cc6281f3471b3a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/9c5450cdf085e5012e7ba2134cc6281f3471b3a1/bibtex.py |
|
Run BibTeX if needed before the first compilation. | Run BibTeX if needed before the first compilation. This function also checks if BibTeX has been run by someone else, and in this case it tells the system that it should recompile the document. | def first_bib (self): """ Run BibTeX if needed before the first compilation. """ self.run_needed = self.first_run_needed() if self.env.must_compile: return 0 if self.run_needed: return self.run() | 9c5450cdf085e5012e7ba2134cc6281f3471b3a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/9c5450cdf085e5012e7ba2134cc6281f3471b3a1/bibtex.py |
if self.env.execute(["bibtex", "-terse", self.env.src_base], env): | if self.env.execute(["bibtex", self.env.src_base], env): | def run (self): """ This method actually runs BibTeX. """ self.msg(0, _("running BibTeX...")) if self.env.src_path != "": env = { "BIBINPUTS": "%s:%s" % (self.env.src_path, os.getenv("BIBINPUTS", "")) } else: env = {} if self.env.execute(["bibtex", "-terse", self.env.src_base], env): self.env.msg(0, _( "There were errors running BibTeX (see %s for details)." ) % (self.env.src_base + ".blg")) return 1 self.run_needed = 0 self.env.must_compile = 1 return 0 | 9c5450cdf085e5012e7ba2134cc6281f3471b3a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/9c5450cdf085e5012e7ba2134cc6281f3471b3a1/bibtex.py |
self.date = time.time() | self.date = int(time.time()) | def make (self): """ Make the destination file. This recursively makes all dependencies, then compiles the target if dependencies were modified. The semantics of the return value is the following: - 0 means that the process failed somewhere (in this node or in one of its dependencies) - 1 means that nothing had to be done - 2 means that something was recompiled (therefore nodes that depend on this one have to be remade) """ must_make = 0 for src in self.sources.values(): ret = src.make() if ret == 0: return 0 if ret == 2: must_make = 1 if must_make or self.should_make(): if self.run(): return 0 self.date = time.time() return 2 return 1 | 01b63475c6b2b6915a0fe755d087c2fbd625a89b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/01b63475c6b2b6915a0fe755d087c2fbd625a89b/util.py |
env.msg(2, "%s is made from %r" % (target, sources)) | env.msg(2, _("%s is made from %r") % (target, sources)) | def __init__ (self, target, source, env): sources = [] self.include(source, sources) env.msg(2, "%s is made from %r" % (target, sources)) self.leaf = DependLeaf(sources) Depend.__init__(self, [target], {source: self.leaf}) self.env = env self.base = source[:-3] self.cmd = ["mpost", "--interaction=batchmode", self.base] if env.src_path != "": cmd = [ "env", "MPINPUTS=:%s:%s" % (self.env.src_path, os.getenv("MPINPUTS", ""))] + cmd | 91fc46b2570410ffe13d56dee35f72400bb6411d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/91fc46b2570410ffe13d56dee35f72400bb6411d/mpost.py |
self.env.msg(0, "running Metapost on %s.mp..." % self.base) | self.env.msg(0, _("running Metapost on %s.mp...") % self.base) | def run (self): self.env.msg(0, "running Metapost on %s.mp..." % self.base) self.env.execute(self.cmd) | 91fc46b2570410ffe13d56dee35f72400bb6411d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/91fc46b2570410ffe13d56dee35f72400bb6411d/mpost.py |
self.msg(0, line.rstrip()) | self.env.msg(0, line.rstrip()) | def run (self): self.env.msg(0, "running Metapost on %s.mp..." % self.base) self.env.execute(self.cmd) | 91fc46b2570410ffe13d56dee35f72400bb6411d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/91fc46b2570410ffe13d56dee35f72400bb6411d/mpost.py |
self.msg(0, _("There were errors in Metapost code:")) self.msg(0, line.rstrip()) | self.env.msg(0, _("There were errors in Metapost code:")) self.env.msg(0, line.rstrip()) | def run (self): self.env.msg(0, "running Metapost on %s.mp..." % self.base) self.env.execute(self.cmd) | 91fc46b2570410ffe13d56dee35f72400bb6411d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/91fc46b2570410ffe13d56dee35f72400bb6411d/mpost.py |
do_check() | ret = do_check() sys.exit(ret) | def do_setup (): """ Run the setup() function from the distutils with appropriate arguments. """ from distutils.core import setup try: mandir = expand_vars(settings.sub, settings.sub["mandir"]) except NameError: mandir = "man" setup( name = "rubber", version = settings.sub["version"], description = "The Rubber system for building LaTeX documents", long_description = """\ | 1514e2a792ba966a4bae61623f5c2fc2316aeb9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/1514e2a792ba966a4bae61623f5c2fc2316aeb9a/setup.py |
msg.warn(_("dependency '%s' not found") % arg, **pos) | msg.warn(_("dependency '%s' not found") % arg, **self.vars) | def do_depend (self, *args): for arg in args: file = self.env.find_file(arg) if file: self.sources[file] = DependLeaf(self.env, file) else: msg.warn(_("dependency '%s' not found") % arg, **pos) | e4864d9634be4f6abd17ad90a93368930cf7802f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/e4864d9634be4f6abd17ad90a93368930cf7802f/__init__.py |
for line in file.readlines(): | for line in fd.readlines(): | def include (self, source, list): """ This function tries to find a specified MetaPost source (currently all in the same directory), appends its actual name to the list, and parses it to find recursively included files. """ if exists(source + ".mp"): file = source + ".mp" elif exists(source): file = source else: return list.append(file) fd = open(file) for line in file.readlines(): m = re_input.search(line) if m: self.include(m["file"]) fd.close() | 82290bea6b566382cc9814e4068e40c6dbb9422b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/82290bea6b566382cc9814e4068e40c6dbb9422b/mpost.py |
self.include(m["file"]) | self.include(m.group("file"), list) | def include (self, source, list): """ This function tries to find a specified MetaPost source (currently all in the same directory), appends its actual name to the list, and parses it to find recursively included files. """ if exists(source + ".mp"): file = source + ".mp" elif exists(source): file = source else: return list.append(file) fd = open(file) for line in file.readlines(): m = re_input.search(line) if m: self.include(m["file"]) fd.close() | 82290bea6b566382cc9814e4068e40c6dbb9422b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/82290bea6b566382cc9814e4068e40c6dbb9422b/mpost.py |
def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": # We check for the substring "warning:" because pdfTeX # sometimes issues warnings (like undefined references) in the # form of errors... | bebabe8d0cd32d7c1fa4d0ec91094782a2e99e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/bebabe8d0cd32d7c1fa4d0ec91094782a2e99e1f/__init__.py |
||
if string.find(line, "warning:") == -1: | if string.find(line, "pdfTeX warning") == -1: | def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": # We check for the substring "warning:" because pdfTeX # sometimes issues warnings (like undefined references) in the # form of errors... | bebabe8d0cd32d7c1fa4d0ec91094782a2e99e1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/bebabe8d0cd32d7c1fa4d0ec91094782a2e99e1f/__init__.py |
self.env.process.src_pbase, self.env.process.out_ext, string.join(self.env.process.depends.keys())) | self.env.src_base, self.env.out_ext, string.join(self.env.depends.keys())) | def main (self, cmdline): self.env = Environment(self.msg) self.modules = [] self.act = None args = self.parse_opts(cmdline) self.msg(1, _( "This is Rubber's information extractor version %s.") % version) | 465d5b94d26a1004d44c9c2d77b262f61e494ceb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/465d5b94d26a1004d44c9c2d77b262f61e494ceb/cmd_info.py |
if self.env.prepare(src): | if self.env.set_source(src): sys.exit(1) if self.env.make_source(): | def prepare (self, src): """ Check for the source file and prepare it for processing. """ if self.env.prepare(src): sys.exit(1) for mod in self.modules: colon = mod.find(":") if colon == -1: if self.env.modules.register(mod, { "arg": mod, "opt": None }): self.msg( 0, _("module %s could not be registered") % mod) else: arg = { "arg": mod[:colon], "opt": mod[colon+1:] } mod = mod[0:colon] if self.env.modules.register(mod, arg): self.msg( 0, _("module %s could not be registered") % mod) self.env.parse() | 465d5b94d26a1004d44c9c2d77b262f61e494ceb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/465d5b94d26a1004d44c9c2d77b262f61e494ceb/cmd_info.py |
return None, None | def do_watch (self, *args): for arg in args: self.watch_file(arg) | 87a9df4b38beecf23f999206a399ef643259af21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/87a9df4b38beecf23f999206a399ef643259af21/__init__.py |
|
self.failed_dep = mod | self.failed_module = mod | def pre_compile (self): """ Prepare the source for compilation using package-specific functions. This function must return true on failure. This function sets `must_compile' to 1 if we already know that a compilation is needed, because it may avoid some unnecessary preprocessing (e.g. BibTeXing). """ if os.path.exists(self.src_base + ".aux"): self.aux_md5 = md5_file(self.src_base + ".aux") else: self.aux_md5 = None self.aux_md5_old = None | 87a9df4b38beecf23f999206a399ef643259af21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/87a9df4b38beecf23f999206a399ef643259af21/__init__.py |
self.failed_dep = mod | self.failed_module = mod | def post_compile (self): """ Run the package-specific operations that are to be performed after each compilation of the main source. Returns true on failure. """ msg.log(_("running post-compilation scripts...")) | 87a9df4b38beecf23f999206a399ef643259af21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/87a9df4b38beecf23f999206a399ef643259af21/__init__.py |
self.log.show_errors() | if self.failed_module is None: self.log.show_errors() else: self.failed_module.show_errors() | def show_errors (self): self.log.show_errors() | 87a9df4b38beecf23f999206a399ef643259af21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/87a9df4b38beecf23f999206a399ef643259af21/__init__.py |
bbl = env.src_base + ".bbl" | def __init__ (self, env, dict): """ Initialize the state of the module and register appropriate functions in the main process. """ self.env = env self.msg = env.msg | f771d0b2eed07cc715ed06d32adb376e18ad0375 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/f771d0b2eed07cc715ed06d32adb376e18ad0375/bibtex.py |
|
Run BibTeX if needed before the first compilation. | Run BibTeX if needed before the first compilation. This function also checks if BibTeX has been run by someone else, and in this case it tells the system that it should recompile the document. | def first_bib (self): """ Run BibTeX if needed before the first compilation. """ self.run_needed = self.first_run_needed() if self.env.must_compile: return 0 if self.run_needed: return self.run() | f771d0b2eed07cc715ed06d32adb376e18ad0375 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/f771d0b2eed07cc715ed06d32adb376e18ad0375/bibtex.py |
if self.env.execute(["bibtex", "-terse", self.env.src_base], env): | if self.env.execute(["bibtex", self.env.src_base], env): | def run (self): """ This method actually runs BibTeX. """ self.msg(0, _("running BibTeX...")) if self.env.src_path != "": env = { "BIBINPUTS": "%s:%s" % (self.env.src_path, os.getenv("BIBINPUTS", "")) } else: env = {} if self.env.execute(["bibtex", "-terse", self.env.src_base], env): self.env.msg(0, _( "There were errors running BibTeX (see %s for details)." ) % (self.env.src_base + ".blg")) return 1 self.run_needed = 0 self.env.must_compile = 1 return 0 | f771d0b2eed07cc715ed06d32adb376e18ad0375 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/f771d0b2eed07cc715ed06d32adb376e18ad0375/bibtex.py |
self.base = target[:-3] | self.base = source[:-3] | def __init__ (self, target, source, env): leaf = DependLeaf([source]) Depend.__init__(self, [target], {source: leaf}) self.env = env self.base = target[:-3] self.cmd = ["mpost", "--interaction=batchmode", self.base] | cf169fcc124c35355295d36a361cda8c059f55ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/cf169fcc124c35355295d36a361cda8c059f55ba/mpost.py |
"tcidvi" : [""], "textures" : ["", ".ps", ".eps", ".pict"], | "tcidvi" : [], "textures" : [".ps", ".eps", ".pict"], | # default suffixes for each device driver (taken from the .def files) | 963a300a800b319ecbd714c86591e203ff6ccb75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/963a300a800b319ecbd714c86591e203ff6ccb75/graphics.py |
self.cmd_t = ["fig2dev", "-L", lang + "_t", "-p", epsname, fig, tex ] | self.cmd_t = ["fig2dev", "-L", lang + "_t", "-p", os.path.basename(epsname), fig, tex ] | def __init__ (self, env, tex, fig, vars, module=None, loc={}): """ The arguments of the constructor are, respectively, the figure's source, the LaTeX source produced, the EPS figure produced, the name to use for it (probably the same one), and the environment. """ leaf = DependLeaf(env, fig, loc=loc) self.env = env | 8358ad5e46ca9fa00d2a82b0a068086fa83e650f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/8358ad5e46ca9fa00d2a82b0a068086fa83e650f/fig2dev.py |
re_file = re.compile("(\\((?P<file>[^ ()]*)|\\))") | re_file = re.compile("(\\((?P<file>[^ (){}]*)|\\))") | def register (self, name, dict={}): """ Attempt to register a package with the specified name. If a module is found, create an object from the module's class called `Module', passing it the environment and `dict' as arguments. This dictionary describes the command that caused the registration. """ r = self.load_module(name, "rubber.modules") if r == 0: self.env.msg(3, _("no support found for %s") % name) return 1 elif r == 2: self.env.msg(3, _("module %s already registered") % name) return 1 mod = self.modules[name].Module(self.env, dict) self.env.msg(2, _("module %s registered") % name) self.objects[name] = mod return 0 | 472fee29baf4da489ab4c72d5e5b08f3a11f9af2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/472fee29baf4da489ab4c72d5e5b08f3a11f9af2/__init__.py |
saved = self.vars.copy() | saved = {} | def push_vars (self, **dict): """ For each named argument "key=val", save the value of variable "key" and assign it the value "val". """ saved = self.vars.copy() for (key, val) in dict.items(): self.vars[key] = val self.vars_stack.append(saved) | ae0ee40faa9a7fc46e029d4c283953ca1f36569f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/ae0ee40faa9a7fc46e029d4c283953ca1f36569f/__init__.py |
self.vars = self.vars_stack[-1] | self.vars.update(self.vars_stack[-1]) | def pop_vars (self): """ Restore the last set of variables saved using "push_vars". """ self.vars = self.vars_stack[-1] del self.vars_stack[-1] | ae0ee40faa9a7fc46e029d4c283953ca1f36569f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/ae0ee40faa9a7fc46e029d4c283953ca1f36569f/__init__.py |
def __init__ (self, env, dict): | 47301e77dfa38b08dd46d83de104ffc53f3f5837 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/47301e77dfa38b08dd46d83de104ffc53f3f5837/expand.py |
||
if not self.expand_needed(): return 0 | def run (self): if not self.expand_needed(): return 0 self.msg(0, _("writing %s...") % (self.out)) self.out_stream = open(self.out, "w") try: self.expand_path(self.env.source()) except rubber.EndDocument: self.out_stream.write("\\end{document}\n") self.out_stream.close() self.env.something_done = 1 | 47301e77dfa38b08dd46d83de104ffc53f3f5837 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/47301e77dfa38b08dd46d83de104ffc53f3f5837/expand.py |
|
try: self.expand_path(self.env.source()) except rubber.EndDocument: self.out_stream.write("\\end{document}\n") self.out_stream.close() self.env.something_done = 1 def expand_needed (self): """ Check if running epxanding the source is needed. """ final = self.env.src_base + "-final.tex" if not exists(final): self.msg(3, _("the expanded file doesn't exist")) return 1 if getmtime(final) < getmtime(self.env.src_base + ".dvi"): self.msg(3, _("the expanded file is older than the DVI")) return 1 self.msg(3, _("expansion is not needed")) return 0 def expand_path (self, path): file = open(path) | def run (self): if not self.expand_needed(): return 0 self.msg(0, _("writing %s...") % (self.out)) self.out_stream = open(self.out, "w") try: self.expand_path(self.env.source()) except rubber.EndDocument: self.out_stream.write("\\end{document}\n") self.out_stream.close() self.env.something_done = 1 | 47301e77dfa38b08dd46d83de104ffc53f3f5837 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/47301e77dfa38b08dd46d83de104ffc53f3f5837/expand.py |
|
self.env.do_process(file, path, dump=self.out_stream) | try: self.expand_path(self.env.source()) except rubber.EndDocument: self.out_stream.write("\\end{document}\n") | def expand_path (self, path): # self.out_stream.write("%%--- beginning of file %s\n" % path) file = open(path) | 47301e77dfa38b08dd46d83de104ffc53f3f5837 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/47301e77dfa38b08dd46d83de104ffc53f3f5837/expand.py |
for key in self.pkg_hooks.keys(): del self.env.hooks[key] self.env.update_seq() | for key in self.pkg_hooks.keys(): del self.env.hooks[key] self.env.update_seq() | def x_usepackage (self, dict): if not dict["arg"]: return remaining = [] | 47301e77dfa38b08dd46d83de104ffc53f3f5837 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/47301e77dfa38b08dd46d83de104ffc53f3f5837/expand.py |
return 0 | continue | def main (self, cmdline): """ Run Rubber for the specified command line. This processes each specified source in order (for making or cleaning). If an error happens while making one of the documents, the whole process stops. The method returns the program's exit code. """ self.prologue = [] self.epilogue = [] self.clean = 0 self.force = 0 | 9cdf7fd167703afdfe39c50520736586b0ea0115 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/9cdf7fd167703afdfe39c50520736586b0ea0115/cmdline.py |
self.conf = Config() | def __init__ (self, message): """ Initialize the environment. This prepares the processing steps for the given file (all steps are initialized empty) and sets the regular expressions and the hook dictionary. """ self.msg = message self.msg(2, _("initializing Rubber...")) | bfb43fdeaf797081a2f88b478038412062aef13d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/bfb43fdeaf797081a2f88b478038412062aef13d/__init__.py |
|
self.msg(1, _("initializing...")) | self.msg(1, _("reinitializing...")) | def restart (self): """ Reinitialize the environment, in order to process a new document. This resets the process and the hook dictionary and unloads modules. """ self.msg(1, _("initializing...")) self.modules.clear() self.initialize() | bfb43fdeaf797081a2f88b478038412062aef13d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/bfb43fdeaf797081a2f88b478038412062aef13d/__init__.py |
self.modules.register("bibtex", dict) for db in dict["arg"].split(","): self.modules["bibtex"].add_db(db) | if dict["arg"]: self.modules.register("bibtex", dict) for db in dict["arg"].split(","): self.modules["bibtex"].add_db(db) | def h_bibliography (self, dict): """ Called when the macro \\bibliography is found. This method actually registers the module bibtex (if not already done) and registers the databases. """ self.modules.register("bibtex", dict) for db in dict["arg"].split(","): self.modules["bibtex"].add_db(db) | 6758a98afaba28ba41556b5310508a4f507cefcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/6758a98afaba28ba41556b5310508a4f507cefcc/__init__.py |
self.modules.register("bibtex", dict) self.modules["bibtex"].set_style(dict["arg"]) | if dict["arg"]: self.modules.register("bibtex", dict) self.modules["bibtex"].set_style(dict["arg"]) | def h_bibliographystyle (self, dict): """ Called when \\bibliographystyle is found. This registers the module bibtex (if not already done) and calls the method set_style() of the module. """ self.modules.register("bibtex", dict) self.modules["bibtex"].set_style(dict["arg"]) | 6758a98afaba28ba41556b5310508a4f507cefcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/6758a98afaba28ba41556b5310508a4f507cefcc/__init__.py |
if self.src_path != "": | if self.src_path == "": self.src_path = "." else: | def set_source (self, path): """ Specify the main source for the document. The exact path and file name are determined, and the source building process is updated if needed, according the the source file's extension. """ name = self.conf.find_input(path) if not name: self.msg(0, _("cannot find %s") % path) return 1 self.depends = {} (self.src_path, name) = split(name) if self.src_path != "": self.conf.path.append(self.src_path) (self.src_base, self.src_ext) = splitext(name) self.src_pbase = join(self.src_path, self.src_base) | 6758a98afaba28ba41556b5310508a4f507cefcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/6758a98afaba28ba41556b5310508a4f507cefcc/__init__.py |
self.pbase = doc.src_base | def __init__ (self, doc, source, target, transcript): """ Initialize the index, by specifying the source file (generated by LaTeX), the target file (the output of makeindex) and the transcript (e.g. .ilg) file. Transcript is used by glosstex.py. """ self.doc = doc self.pbase = doc.src_base self.source = doc.src_base + "." + source self.target = doc.src_base + "." + target self.transcript = doc.src_base + "." + transcript if os.path.exists(self.source): self.md5 = md5_file(self.source) else: self.md5 = None | 83e15aff8f37055b316114051eb562a884eee441 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/83e15aff8f37055b316114051eb562a884eee441/index.py |
|
cmd = ["makeindex", "-o", self.target] + self.opts | cmd = ["makeindex", "-q", "-o", self.target] + self.opts | def post_compile (self): """ Run makeindex if needed, with appropriate options and environment. """ if not os.path.exists(self.source): msg.log(_("strange, there is no %s") % self.source, pkg="index") return 0 if not self.run_needed(): return 0 | 83e15aff8f37055b316114051eb562a884eee441 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/83e15aff8f37055b316114051eb562a884eee441/index.py |
cmd.append(self.pbase) | cmd.append(self.source) | def post_compile (self): """ Run makeindex if needed, with appropriate options and environment. """ if not os.path.exists(self.source): msg.log(_("strange, there is no %s") % self.source, pkg="index") return 0 if not self.run_needed(): return 0 | 83e15aff8f37055b316114051eb562a884eee441 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/83e15aff8f37055b316114051eb562a884eee441/index.py |
if exists(test): | if exists(test) and isfile(test): | def find_input (self, name): """ Look for a source file with the given name, and return either the complete path to the actual file or None if the file is not found. """ for path in self.path: test = join(path, name) if exists(test): return test elif exists(test + ".tex"): return test + ".tex" return None | 26e30c37c4cc88691045b15badadff8eb1cabe02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/26e30c37c4cc88691045b15badadff8eb1cabe02/__init__.py |
elif exists(test + ".tex"): | elif exists(test + ".tex") and isfile(test + ".tex"): | def find_input (self, name): """ Look for a source file with the given name, and return either the complete path to the actual file or None if the file is not found. """ for path in self.path: test = join(path, name) if exists(test): return test elif exists(test + ".tex"): return test + ".tex" return None | 26e30c37c4cc88691045b15badadff8eb1cabe02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/26e30c37c4cc88691045b15badadff8eb1cabe02/__init__.py |
self.env.process.src_pbase, self.env.process.out_ext, string.join(self.env.process.depends.keys())) | self.env.src_base, self.env.out_ext, string.join(self.env.depends.keys())) | def main (self, cmdline): self.env = Environment(self.msg) self.modules = [] self.act = None args = self.parse_opts(cmdline) self.msg(1, _( "This is Rubber's information extractor version %s.") % version) | 35e9df85e96e9f9c21efedebd50ba3f558238aac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/35e9df85e96e9f9c21efedebd50ba3f558238aac/cmd_info.py |
if self.env.prepare(src): | if self.env.set_source(src): sys.exit(1) if self.env.make_source(): | def prepare (self, src): """ Check for the source file and prepare it for processing. """ if self.env.prepare(src): sys.exit(1) for mod in self.modules: colon = mod.find(":") if colon == -1: if self.env.modules.register(mod, { "arg": mod, "opt": None }): self.msg( 0, _("module %s could not be registered") % mod) else: arg = { "arg": mod[:colon], "opt": mod[colon+1:] } mod = mod[0:colon] if self.env.modules.register(mod, arg): self.msg( 0, _("module %s could not be registered") % mod) self.env.parse() | 35e9df85e96e9f9c21efedebd50ba3f558238aac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/35e9df85e96e9f9c21efedebd50ba3f558238aac/cmd_info.py |
self.modules.register("bibtex", dict) for db in dict["arg"].split(","): self.modules["bibtex"].add_db(db) | if dict["arg"]: self.modules.register("bibtex", dict) for db in dict["arg"].split(","): self.modules["bibtex"].add_db(db) | def h_bibliography (self, dict): """ Called when the macro \\bibliography is found. This method actually registers the module bibtex (if not already done) and registers the databases. """ self.modules.register("bibtex", dict) for db in dict["arg"].split(","): self.modules["bibtex"].add_db(db) | a89c6e69e246c08c08ac0a0d07ecc8fff1d254d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/a89c6e69e246c08c08ac0a0d07ecc8fff1d254d1/__init__.py |
self.modules.register("bibtex", dict) self.modules["bibtex"].set_style(dict["arg"]) | if dict["arg"]: self.modules.register("bibtex", dict) self.modules["bibtex"].set_style(dict["arg"]) | def h_bibliographystyle (self, dict): """ Called when \\bibliographystyle is found. This registers the module bibtex (if not already done) and calls the method set_style() of the module. """ self.modules.register("bibtex", dict) self.modules["bibtex"].set_style(dict["arg"]) | a89c6e69e246c08c08ac0a0d07ecc8fff1d254d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/a89c6e69e246c08c08ac0a0d07ecc8fff1d254d1/__init__.py |
if self.src_path != "": | if self.src_path == "": self.src_path = "." else: | def set_source (self, path): """ Specify the main source for the document. The exact path and file name are determined, and the source building process is updated if needed, according the the source file's extension. """ name = self.conf.find_input(path) if not name: self.msg(0, _("cannot find %s") % path) return 1 self.depends = {} (self.src_path, name) = split(name) if self.src_path != "": self.conf.path.append(self.src_path) (self.src_base, self.src_ext) = splitext(name) self.src_pbase = join(self.src_path, self.src_base) | a89c6e69e246c08c08ac0a0d07ecc8fff1d254d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/a89c6e69e246c08c08ac0a0d07ecc8fff1d254d1/__init__.py |
saved = self.vars.copy() | saved = {} | def push_vars (self, **dict): """ For each named argument "key=val", save the value of variable "key" and assign it the value "val". """ saved = self.vars.copy() for (key, val) in dict.items(): self.vars[key] = val self.vars_stack.append(saved) | 4ccb857958a8fc501d474f6f41e29f4f5ed500f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/4ccb857958a8fc501d474f6f41e29f4f5ed500f1/__init__.py |
self.vars = self.vars_stack[-1] | self.vars.update(self.vars_stack[-1]) | def pop_vars (self): """ Restore the last set of variables saved using "push_vars". """ self.vars = self.vars_stack[-1] del self.vars_stack[-1] | 4ccb857958a8fc501d474f6f41e29f4f5ed500f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/4ccb857958a8fc501d474f6f41e29f4f5ed500f1/__init__.py |
saved = {} | saved = self.vars.copy() | def push_vars (self, **dict): """ For each named argument "key=val", save the value of variable "key" and assign it the value "val". """ saved = {} for (key, val) in dict.items(): saved[key] = self.vars[key] self.vars[key] = val self.vars_stack.append(saved) | ce7bd4fb6fecd708f029caa5338a8916e16fd148 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/ce7bd4fb6fecd708f029caa5338a8916e16fd148/__init__.py |
saved[key] = self.vars[key] | def push_vars (self, **dict): """ For each named argument "key=val", save the value of variable "key" and assign it the value "val". """ saved = {} for (key, val) in dict.items(): saved[key] = self.vars[key] self.vars[key] = val self.vars_stack.append(saved) | ce7bd4fb6fecd708f029caa5338a8916e16fd148 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/ce7bd4fb6fecd708f029caa5338a8916e16fd148/__init__.py |
|
self.vars.update(self.vars_stack[-1]) | self.vars = self.vars_stack[-1] | def pop_vars (self): """ Restore the last set of variables saved using "push_vars". """ self.vars.update(self.vars_stack[-1]) del self.vars_stack[-1] | ce7bd4fb6fecd708f029caa5338a8916e16fd148 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/ce7bd4fb6fecd708f029caa5338a8916e16fd148/__init__.py |
re_file = re.compile("(\((?P<file>[^ ()]*)|\))") | re_file = re.compile("(\\((?P<file>[^ ()]*)|\\))") re_badbox = re.compile("(Ov|Und)erfull \\\\[hv]box ") | def register (self, name, dict={}): """ Attempt to register a package with the specified name. If a module is found, create an object from the module's class called `Module', passing it the environment and `dict' as arguments. This dictionary describes the command that caused the registration. """ r = self.load_module(name, "rubber.modules") if r == 0: self.env.msg(3, _("no support found for %s") % name) return 1 elif r == 2: self.env.msg(3, _("module %s already registered") % name) return 1 mod = self.modules[name].Module(self.env, dict) self.env.msg(2, _("module %s registered") % name) self.objects[name] = mod return 0 | be6975304f1695d2e8d5d95920b195bbd4313432 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/be6975304f1695d2e8d5d95920b195bbd4313432/__init__.py |
stack[0] is the main source while stack[-1] is the current one. | stack[1] is the main source while stack[-1] is the current one. The first element, stack[0], contains the string \"(no file)\" for errors that may happen outside the source. | def update_file (self, line, stack): """ Parse the given line of log file for file openings and closings and update the list `stack'. Newly opened files are at the end, therefore stack[0] is the main source while stack[-1] is the current one. """ m = re_file.search(line) if not m: return while m: if line[m.start()] == '(': stack.append(m.group("file")) else: del stack[-1] line = line[m.end():] m = re_file.search(line) return | be6975304f1695d2e8d5d95920b195bbd4313432 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/be6975304f1695d2e8d5d95920b195bbd4313432/__init__.py |
showing = 0 something = 0 | showing = 0 skipping = 0 something = 0 | def show_errors (self): """ Display all errors that occured during compilation. Return 0 if there was no error. """ pos = ["(no file)"] last_file = None showing = 0 something = 0 for line in self.lines: line = line.rstrip() if line == "": continue if showing: self.msg(0, line) if line[0:2] == "l." or line[0:3] == "***": showing = 0 else: self.update_file(line, pos) else: if line[0] == "!": if pos[-1] != last_file: last_file = pos[-1] self.msg(0, _("in file %s:") % last_file) self.msg(0, line) showing = 1 something = 1 else: self.update_file(line, pos) return something | be6975304f1695d2e8d5d95920b195bbd4313432 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/be6975304f1695d2e8d5d95920b195bbd4313432/__init__.py |
continue if showing: | skipping = 0 elif skipping: pass elif showing: | def show_errors (self): """ Display all errors that occured during compilation. Return 0 if there was no error. """ pos = ["(no file)"] last_file = None showing = 0 something = 0 for line in self.lines: line = line.rstrip() if line == "": continue if showing: self.msg(0, line) if line[0:2] == "l." or line[0:3] == "***": showing = 0 else: self.update_file(line, pos) else: if line[0] == "!": if pos[-1] != last_file: last_file = pos[-1] self.msg(0, _("in file %s:") % last_file) self.msg(0, line) showing = 1 something = 1 else: self.update_file(line, pos) return something | be6975304f1695d2e8d5d95920b195bbd4313432 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/be6975304f1695d2e8d5d95920b195bbd4313432/__init__.py |
if line[0] == "!": if pos[-1] != last_file: last_file = pos[-1] self.msg(0, _("in file %s:") % last_file) self.msg(0, line) showing = 1 something = 1 | m = re_badbox.match(line) if m: skipping = 1 | def show_errors (self): """ Display all errors that occured during compilation. Return 0 if there was no error. """ pos = ["(no file)"] last_file = None showing = 0 something = 0 for line in self.lines: line = line.rstrip() if line == "": continue if showing: self.msg(0, line) if line[0:2] == "l." or line[0:3] == "***": showing = 0 else: self.update_file(line, pos) else: if line[0] == "!": if pos[-1] != last_file: last_file = pos[-1] self.msg(0, _("in file %s:") % last_file) self.msg(0, line) showing = 1 something = 1 else: self.update_file(line, pos) return something | be6975304f1695d2e8d5d95920b195bbd4313432 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/be6975304f1695d2e8d5d95920b195bbd4313432/__init__.py |
self.cwd = join(curdir, "") | self.cwd = "./" | def __init__ (self, level=1, write=None): """ Initialize the object with the specified verbosity level and an optional writing function. If no such function is specified, no message will be output until the 'write' field is changed. """ self.level = level self.write = write self.short = 0 self.path = "" self.cwd = join(curdir, "") | 0fa16dbe178da09aaef880a0c360971acc345cdc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/0fa16dbe178da09aaef880a0c360971acc345cdc/__init__.py |
rule = dict(cp.items(name)) | rule = {} for key in cp.options(name): rule[key] = cp.get(name, key) | def read_ini (self, filename): """ Read a set of rules from a file. See the texinfo documentation for the expected format of this file. """ from ConfigParser import ConfigParser cp = ConfigParser() cp.read(filename) for name in cp.sections(): rule = dict(cp.items(name)) rule["cost"] = cost = cp.getint(name, "cost") expr = re.compile(rule["target"] + "$") self.rules[name] = (expr, cost, rule) | 0fa16dbe178da09aaef880a0c360971acc345cdc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/0fa16dbe178da09aaef880a0c360971acc345cdc/__init__.py |
pdfTeX = string.find(line, "pdfTeX warning") == -1 | pdfTeX = string.find(line, "pdfTeX warning") != -1 | def parse (self, errors=0, boxes=0, refs=0, warnings=0): """ Parse the log file for relevant information. The named arguments are booleans that indicate which information should be extracted: - errors: all errors - boxes: bad boxes - refs: warnings about references - warnings: all other warnings The function returns a generator. Each generated item is a dictionary that contains (some of) the following entries: - kind: the kind of information ("error", "box", "ref", "warning") - text: the text of the error or warning - code: the piece of code that caused an error - file, line, last, pkg: as used by Message.format_pos. """ if not self.lines: return last_file = None pos = [last_file] page = 1 parsing = 0 # 1 if we are parsing an error's text skipping = 0 # 1 if we are skipping text until an empty line something = 0 # 1 if some error was found prefix = None # the prefix for warning messages from packages accu = "" # accumulated text from the previous line for line in self.lines: line = line[:-1] # remove the line feed | 038463871625a073ab8d0e73fed75cf064e41d45 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/038463871625a073ab8d0e73fed75cf064e41d45/__init__.py |
def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": # We check for the substring "warning:" because pdfTeX # sometimes issues warnings (like undefined references) in the # form of errors... | df4dbe9c77d9f58d8bb6b945c05c01431b20646e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/df4dbe9c77d9f58d8bb6b945c05c01431b20646e/__init__.py |
||
if string.find(line, "warning:") == -1: | if string.find(line, "pdfTeX warning") == -1: | def errors (self): """ Returns true if there was an error during the compilation. """ for line in self.lines: if line[0] == "!": # We check for the substring "warning:" because pdfTeX # sometimes issues warnings (like undefined references) in the # form of errors... | df4dbe9c77d9f58d8bb6b945c05c01431b20646e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/df4dbe9c77d9f58d8bb6b945c05c01431b20646e/__init__.py |
return 0 if self.undef_cites != new: | elif self.undef_cites != new: | def bibtex_needed (self): """ Return true if BibTeX must be run. """ if self.run_needed: return 1 self.msg(2, _("checking if BibTeX must be run...")) | ca49fe2e7c8984795e9311971ade3b20aac20344 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/ca49fe2e7c8984795e9311971ade3b20aac20344/bibtex.py |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.