diff options
author | michele.simionato <devnull@localhost> | 2009-02-05 06:54:40 +0000 |
---|---|---|
committer | michele.simionato <devnull@localhost> | 2009-02-05 06:54:40 +0000 |
commit | 9eaa1291cbf37ef28906d380711d99efa4e46a2b (patch) | |
tree | 62136a7b30942fdbca38d0da782680c71f1dbf26 /scheme2rst.py | |
parent | 52058cb8fdd2f649daafb4d2cdc6e44db505da37 (diff) | |
download | micheles-9eaa1291cbf37ef28906d380711d99efa4e46a2b.tar.gz |
Empowered scheme2rst to look at the aps directory too
Diffstat (limited to 'scheme2rst.py')
-rw-r--r-- | scheme2rst.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scheme2rst.py b/scheme2rst.py index 74d2bad..dbff86f 100644 --- a/scheme2rst.py +++ b/scheme2rst.py @@ -13,16 +13,21 @@ import os, sys, re, webbrowser from docutils.core import publish_cmdline from ms.optionparser import OptionParser +identifier = r'[-A-Z\d_!\?\+\-\*/]+' BIGCOMMENT = re.compile(r'#\|(.*)\|#(.*)', re.DOTALL) -SNIPPET = re.compile(r'\n;+\s*([-A-Z\d_/!\?]+)\s*\n(.*?)\n\s*;+\s*END', +SNIPPET = re.compile(r'\n\s*;+\s*(%s)\s*\n(.*?)\n\s*;+\s*END' % identifier, re.DOTALL) -SNIPPETNAME = re.compile(r'\n\$\$([-A-Z\d_/!\?]+)\n') +SNIPPETNAME = re.compile(r'\n\$\$(%s)\n' % identifier) INCLUDE = re.compile(r'\$\$([-\w\d_\.]+):') -INCLUDESNIPPET = re.compile(r'\$\$([-\w\d_\.]+):([-A-Z\d_/!\?]+)\n') +INCLUDESNIPPET = re.compile(r'\$\$([-\w\d_\.]+):(%s)\n' % identifier) PATH = os.environ['IKARUS_LIBRARY_PATH'] -def include(fname, paths=('.', PATH), exts=('.ss', '.sls')): +APS_PATH = os.path.join(PATH, 'aps') + +PATHS = '.', PATH, APS_PATH + +def include(fname, paths=PATHS, exts=('.ss', '.sls')): for path in paths: for ext in exts: try: |