Exemple #1
0
 def __init__(self, doc, target, source):
     Node.__init__(self, doc.env.depends, [target], [source])
     self.doc = doc
     self.env = doc.env
     self.source = source
     self.target = target
     self.options = []
Exemple #2
0
 def __init__(self, doc, target, source):
     Node.__init__(self, doc.env.depends, [target], [source])
     self.doc = doc
     self.env = doc.env
     self.source = source
     self.target = target
     self.options = []
Exemple #3
0
	def __init__ (self, set, target, source, context):
		sources = []
		self.cmd_pwd = os.path.dirname(source)
		self.include(os.path.basename(source), sources)
		msg.log(_("%s is made from %r") % (target, sources))
		Node.__init__(self, set, [target], sources)
		self.env = context['_environment']
		self.base = source[:-3]
		self.cmd = ["mpost", "\\batchmode;input %s" %
			os.path.basename(self.base)]
		if self.env.path == [""]:
			self.penv = {}
		else:
			path = string.join(self.env.path, ":")
			self.penv = {
				"TEXINPUTS": "%s:%s" % (path, os.getenv("TEXINPUTS", "")),
				"MPINPUTS": "%s:%s" % (path, os.getenv("MPINPUTS", "")) }
		self.log = None
Exemple #4
0
	def __init__ (self, env):
		"""
		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.
		"""
		Node.__init__(self, env.depends)
		self.env = env

		self.log = LogCheck()
		self.modules = Modules(self)

		self.vars = Variables(env.vars, {
			"program": "latex",
			"engine": "TeX",
			"paper": "",
			"arguments": [],
			"src-specials": "",
			"source": None,
			"target": None,
			"path": None,
			"base": None,
			"ext": None,
			"job": None,
			"graphics_suffixes" : [] })
		self.vars_stack = []

		self.cmdline = ["\\nonstopmode", "\\input{%s}"]

		# the initial hooks:

		self.comment_mark = "%"

		self.hooks = {
			"begin": ("a", self.h_begin),
			"end": ("a", self.h_end),
			"pdfoutput": ("", self.h_pdfoutput),
			"input" : ("", self.h_input),
			"include" : ("a", self.h_include),
			"includeonly": ("a", self.h_includeonly),
			"usepackage" : ("oa", self.h_usepackage),
			"RequirePackage" : ("oa", self.h_usepackage),
			"documentclass" : ("oa", self.h_documentclass),
			"LoadClass" : ("oa", self.h_documentclass),
			"LoadClassWithOptions" : ("a", self.h_documentclass),
			"tableofcontents" : ("", self.h_tableofcontents),
			"listoffigures" : ("", self.h_listoffigures),
			"listoftables" : ("", self.h_listoftables),
			"bibliography" : ("a", self.h_bibliography),
			"bibliographystyle" : ("a", self.h_bibliographystyle),
			"endinput" : ("", self.h_endinput)
		}
		self.begin_hooks = {
			"verbatim": self.h_begin_verbatim,
			"verbatim*": lambda loc: self.h_begin_verbatim(loc, env="verbatim\\*")
		}
		self.end_hooks = {
			"document": self.h_end_document
		}
		self.hooks_changed = True

		self.include_only = {}

		# description of the building process:

		self.aux_md5 = {}
		self.aux_old = {}
		self.watched_files = {}
		self.onchange_md5 = {}
		self.onchange_cmd = {}
		self.removed_files = []
		self.not_included = []  # dependencies that don't trigger latex

		# state of the builder:

		self.processed_sources = {}

		self.must_compile = 0
		self.something_done = 0
		self.failed_module = None
Exemple #5
0
	def __init__ (self, env):
		"""
		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.
		"""
		Node.__init__(self, env.depends)
		self.env = env

		self.log = LogCheck()
		self.modules = Modules(self)

		self.vars = Variables(env.vars, {
			"program": "latex",
			"engine": "TeX",
			"paper": "",
			"arguments": [],
			"src-specials": "",
			"source": None,
			"target": None,
			"path": None,
			"base": None,
			"ext": None,
			"job": None,
			"graphics_suffixes" : [] })
		self.vars_stack = []

		self.cmdline = ["\\nonstopmode", "\\input{%s}"]

		if self.vars.get('shell_escape', 0):
			self.cmdline.insert(0, '--shell-escape')

		# the initial hooks:

		self.comment_mark = "%"

		self.hooks = {
			"begin": ("a", self.h_begin),
			"end": ("a", self.h_end),
			"pdfoutput": ("", self.h_pdfoutput),
			"input" : ("", self.h_input),
			"include" : ("a", self.h_include),
			"includeonly": ("a", self.h_includeonly),
			"usepackage" : ("oa", self.h_usepackage),
			"RequirePackage" : ("oa", self.h_usepackage),
			"documentclass" : ("oa", self.h_documentclass),
			"LoadClass" : ("oa", self.h_documentclass),
			"LoadClassWithOptions" : ("a", self.h_documentclass),
			"tableofcontents" : ("", self.h_tableofcontents),
			"listoffigures" : ("", self.h_listoffigures),
			"listoftables" : ("", self.h_listoftables),
			"bibliography" : ("a", self.h_bibliography),
			"bibliographystyle" : ("a", self.h_bibliographystyle),
			"endinput" : ("", self.h_endinput)
		}
		self.begin_hooks = {
			"verbatim": self.h_begin_verbatim,
			"verbatim*": lambda loc: self.h_begin_verbatim(loc, env="verbatim\\*")
		}
		self.end_hooks = {
			"document": self.h_end_document
		}
		self.hooks_changed = True

		self.include_only = {}

		# description of the building process:

		self.aux_md5 = {}
		self.aux_old = {}
		self.watched_files = {}
		self.onchange_md5 = {}
		self.onchange_cmd = {}
		self.removed_files = []
		self.not_included = []  # dependencies that don't trigger latex

		# state of the builder:

		self.processed_sources = {}

		self.must_compile = 0
		self.something_done = 0
		self.failed_module = None
Exemple #6
0
 def __init__(self, set, target, source):
     Node.__init__(self, set, [target], [source])
Exemple #7
0
 def __init__(self, set, target, source):
     Node.__init__(self, set, [target], [source])
     self.source = source
     self.target = target
Exemple #8
0
	def __init__ (self, set, target, source):
		Node.__init__(self, set, [target], [source])
Exemple #9
0
	def __init__ (self, set, target, source):
		Node.__init__(self, set, [target], [source])
		self.source = source
		self.target = target