mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-07 19:30:47 -04:00
28 lines
671 B
Plaintext
28 lines
671 B
Plaintext
$NetBSD: patch-ac,v 1.2 2010/03/12 10:30:04 tonio Exp $
|
|
|
|
Add support for import
|
|
|
|
--- /dev/null 2006-06-01 10:55:34.000000000 +0200
|
|
+++ src/rules/latex/import.py
|
|
@@ -0,0 +1,20 @@
|
|
+"""
|
|
+Support for package 'import' in Rubber.
|
|
+"""
|
|
+
|
|
+from os.path import basename
|
|
+import re
|
|
+import rubber
|
|
+
|
|
+re_ipath = re.compile("{(?P<prefix>[^{}]*)}")
|
|
+class Module (rubber.rules.latex.Module):
|
|
+ def __init__ (self, doc, dict):
|
|
+ self.doc = doc
|
|
+ doc.add_hook("import", self.import_doc)
|
|
+
|
|
+ def import_doc (self, dict):
|
|
+ if not dict["arg"]:
|
|
+ return 0
|
|
+ self.doc.env.path.append(dict["arg"])
|
|
+ m = re_ipath.match(dict["line"])
|
|
+ self.doc.input_file(m.group("prefix") + ".tex")
|