Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Major update to build process

  • Loading branch information...
commit 8a67a0331b660fdf94c754008492d32725678692 1 parent 2b80b93
@davelxmos davelxmos authored
View
41 Makefile.inc
@@ -3,47 +3,10 @@ no_target:
export
-RSYNC = rsync -tur --cvs-exclude --exclude=**.xe --exclude=**.zip --exclude=**_buid** --exclude=**.build** --exclude=**.sources**
-
-# Need to copy in linked dirs before anything else
-ifeq ($(OTHER_DOC_DIRS),)
-_linked_dirs:
- @-mkdir -p .linked_dirs
- @python $(XDOC_DIR)/xsphinx/create_link_map.py $(OTHER_DOC_DIRS)
-
-LINKED_DIRS = _linked_dirs
-else
-.PHONY: _linked_dirs
-
-ifeq ($(NOCOPY),1)
-_linked_dirs:
- @echo Not copying linked dirs
-else
-
-_linked:
- @-mkdir -p .linked_dirs
-
-%.ignore:
- @echo Ignoring $*
- @rm `find .linked_dirs -iname $*`
-
-%._linked: _linked
- @echo Copying in $*
- @$(RSYNC) --exclude=**.linked_dirs** $(abspath $*) .linked_dirs
-
-_linked_dirs: $(foreach x,$(OTHER_DOC_DIRS),$(x)._linked) $(foreach x,$(EXCLUDE_FILES),$(x).ignore)
- @python $(XDOC_DIR)/xsphinx/create_link_map.py $(OTHER_DOC_DIRS)
- @echo "Created linked dirs"
-endif
-
-LINKED_DIRS = _linked_dirs
-endif
-
-
# Now just call Makefile.inc1
define DISPATCH
-$1: $(if $(filter clean,$1),,$(LINKED_DIRS))
- @make --no-print-directory -f $(XDOC_DIR)/Makefile.inc1 $1
+$1:
+ @python $(XDOC_DIR)/xdoc.py $1
endef
$(foreach goal,$(sort html pdf xmoshtml xdehtml xmospdf justlatex xref all_xref cognidox draft issue clean realclean webgen archive copy_remote xdetutorial xmospdf.remote xdehtml.remote),$(eval $(call DISPATCH,$(goal))))
View
2  Makefile.inc1
@@ -135,7 +135,7 @@ singlehtml: doxygen | $(SOURCES)
ifeq ($(VERBOSE),1)
else
-FILTER = 2> _build/$(XLATEX)/sphinx.STDERR > _build/$(XLATEX)/sphinx.STDOUT;cat _build/$(XLATEX)/sphinx.STDERR | python $(XDOC_DIR)/xsphinx/sphinx_filter.py
+FILTER = 2> _build/$(XLATEX)/sphinx.STDERR > _build/$(XLATEX)/sphinx.STDOUT;cat _build/$(XLATEX)/sphinx.STDERR | python $(XDOC_DIR)/xsphinx/sphinx_filter.py _build/sphinx.out
endif
xlatex: doxygen | $(SOURCES)
@echo "Running Sphinx"
View
4 texinput/xcore.cls
@@ -13,7 +13,6 @@
\ProcessOptions
\LoadClass[oneside,onecolumn,article,10pt]{memoir}
-
% Set conservative values to prevent the need
% for too much manual typesetting
\widowpenalty=10000
@@ -436,4 +435,5 @@
\newcommand{\pretoc}{\toc}
\newcommand{\posttoc}{}
-\renewcommand{\printtoctitle}[1]{}
+\renewcommand{\printtoctitle}[1]{}
+
View
318 xdoc.py
@@ -0,0 +1,318 @@
+#!/usr/bin/python
+import sys
+import os
+import re
+import sphinx
+import shutil
+import subprocess
+from xsphinx.check_toc import checktoc
+from xsphinx.run_latex import runlatex
+from xsphinx.sphinx_filter import XSphinxFilter
+import zipfile
+
+# This script is slighty odd in that it is a port of a system that was based on
+# Makefiles. This means that some values are passed around in the OS environment
+# (ugh)
+
+xmossphinx = None
+
+config_defaults = {'OTHER_DOC_DIRS':[],
+ 'DOXYGEN_DIRS':[],
+ 'SOURCE_INCLUDE_DIRS':[],
+ 'SPHINX_MASTER_DOC':'index'}
+
+def get_config(path):
+ config = {}
+ f = open(os.path.join(path,'Makefile'))
+ lines = f.readlines()
+ f.close()
+ for line in lines:
+ m = re.match('(.*)=(.*)',line)
+ if m:
+ key = m.groups(0)[0].strip()
+ value = m.groups(0)[1].strip()
+ if key in config_defaults and config_defaults[key] == []:
+ value = [x for x in value.split(' ') if x != '']
+ config[key] = value
+
+ if not 'SPHINX_MASTER_DOC' in config:
+ rstfiles = [f for f in os.listdir(path) if re.match('.*\.rst$',f)]
+ if 'index.rst' in rstfiles:
+ config['SPHINX_MASTER_DOC'] = 'index'
+ elif len(rstfiles) == 1:
+ config['SPHINX_MASTER_DOC'] = rstfiles[0][:-4]
+ else:
+ sys.stderr.write("Cannot determine main rst file")
+
+ for key,default_value in config_defaults.items():
+ if not key in config:
+ config[key] = default_value
+
+ config['XDOC_DIR'] = os.path.dirname(os.path.abspath(__file__))
+ config['DOC_DIR'] = os.path.abspath(path)
+
+
+ for key,value in config.items():
+ try:
+ os.environ[key] = value
+ except TypeError:
+ os.environ[key] = ' '.join(value)
+
+ return config
+
+def rsync_dir(d,destroot):
+ print "Copying %s" % d
+ exclude_pattern = r'.*\.sources.*|.*\.git.*|.*\.zip|.*\.xe'
+ for root, dirs, files in os.walk(d):
+ for f in files:
+ src = os.path.join(root, f)
+ dst = os.path.normpath(os.path.join(destroot, os.path.relpath(root,d), f))
+ dstpath = os.path.dirname(dst)
+ if not re.match(exclude_pattern, src):
+ copyfile = True
+ if not os.path.exists(dstpath):
+ os.makedirs(os.path.dirname(dst))
+ if os.path.exists(dst):
+ dst_mod_time = os.stat(dst).st_mtime
+ src_mod_time = os.stat(src).st_mtime
+ if src_mod_time - dst_mod_time < 1:
+ copyfile = False
+ if copyfile:
+ shutil.copy2(src, dst)
+
+
+
+
+def rsync_dirs(dirlist, dest):
+ for d in dirlist:
+ rsync_dir(d,os.path.join(dest,os.path.basename(d)))
+
+
+def doDoxygen(xdoc_dir, doc_dir):
+ print "Running Doxygen"
+ build_path = os.path.join(doc_dir,'_build','doxygen')
+ doxyfile_path = os.path.join(doc_dir, 'Doxyfile')
+ if not os.path.exists(build_path):
+ os.makedirs(build_path)
+
+ shutil.copy(os.path.join(xdoc_dir, 'xsphinx', 'Doxyfile'),
+ doxyfile_path)
+
+ cmd = 'doxygen'
+
+ process = subprocess.Popen(cmd,cwd=doc_dir,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+
+ while True:
+ line = process.stdout.readline()
+ if line == '':
+ break
+ if not re.match('.*REFERENCE.*',line):
+ print line
+
+ os.remove(doxyfile_path)
+
+def doLatex(doc_dir,build_dir,config, master, xmoslatex=False):
+
+ texfile = os.path.join(doc_dir,master+".tex")
+ shutil.copy(os.path.join(build_dir,master+".tex"),texfile)
+ os.environ['TEXINPUTS'] += build_dir + ":"
+ filt = XSphinxFilter(sys.stdout, sys.stderr, os.path.join(build_dir,'latex.output'))
+ texfile = master+'.tex'
+ if xmoslatex:
+ import_xmos(config)
+ from xmossphinx.xmos_latex import make_xmos_latex
+ texfile = make_xmos_latex(texfile, config)
+
+ lines = runlatex(doc_dir,['-shell-escape','-interaction','nonstopmode',
+ texfile])
+
+ outfile = texfile.replace('.tex','.pdf')
+ if xmoslatex:
+ shutil.copy(os.path.join(doc_dir,outfile),
+ os.path.join(doc_dir,master+'.pdf'))
+ os.remove(texfile)
+
+ for line in lines:
+ filt.write(line)
+ filt.finish()
+
+def find_files(path):
+ fs = []
+ for root, dirs, files in os.walk(path):
+ for f in files:
+ fs.append(os.path.relpath(os.path.join(root, f),path))
+
+ return fs
+
+def copy_dir_to_zip(z, path, arcpath, pattern=None, exclude = None):
+ for f in find_files(path):
+ fpath = os.path.join(path, f)
+ if (not pattern or re.match(pattern, f)) and \
+ (not exclude or not f == exclude):
+ z.write(fpath,arcname = os.path.join(arcpath, f))
+
+def make_zip(path, config):
+ z = zipfile.ZipFile("issue.zip","w")
+ pdfpath = os.path.join(path,config['SPHINX_MASTER_DOC']+'.pdf')
+ z.write(pdfpath,arcname="output.pdf")
+ z.write(os.path.join(path,'seealso.xml'))
+ master_html = config['SPHINX_MASTER_DOC']+'.html'
+ z.write(os.path.join(path,'_build','xdehtml',master_html),
+ arcname=os.path.join('html','index.html'))
+ copy_dir_to_zip(z,os.path.join(path,'_build','xdehtml'),'html',
+ pattern='.*\.html$', exclude = master_html)
+ copy_dir_to_zip(z,os.path.join(path,'_build','xdehtml','_static'),
+ os.path.join('html','_static'))
+ copy_dir_to_zip(z,os.path.join(path,'_build','xdehtml','images'),
+ os.path.join('html','images'))
+ z.close()
+
+def prebuild(path, xmos_prebuild=False,xmos_publish=False,docnum=None):
+ global xmossphinx
+ config = get_config(path)
+ rsync_dirs(config['OTHER_DOC_DIRS'],'.linked_dirs')
+ rsync_dirs(config['DOXYGEN_DIRS'],'.doxygen')
+ rsync_dirs(config['SOURCE_INCLUDE_DIRS'],'.sources')
+
+ sys.path.append(os.path.join(config['XDOC_DIR'],'xsphinx'))
+
+ if xmos_prebuild:
+ import_xmos(config)
+ from xmossphinx.xmos_process_toc import process_toc
+ from xmossphinx.check_docinfo import check_doc
+ _,docnum = check_doc(path,
+ config['SPHINX_MASTER_DOC'],
+ try_to_create=xmos_publish)
+
+ print "Processing document structure for xref database"
+ process_toc(os.path.join(path,config['SPHINX_MASTER_DOC']+".rst"),
+ docnum,
+ config['OTHER_DOC_DIRS'])
+ if docnum:
+ config['DOCNUM'] = docnum
+ os.environ['DOCNUM'] = docnum
+
+ if config['DOXYGEN_DIRS'] != []:
+ doDoxygen(config['XDOC_DIR'], config['DOC_DIR'])
+
+
+ return config
+
+def import_xmos(config):
+ global xmossphinx
+ if not xmossphinx:
+ sys.path.append(os.path.join(config['XDOC_DIR'],'..','infr_docs'))
+ sys.path.append(os.path.join(config['XDOC_DIR'],'..','infr_docs','xmossphinx'))
+ import xmossphinx
+
+
+def build(path, config, target = 'html',subdoc=None):
+ if target == 'html':
+ builder = 'html'
+ elif target == 'gh-pages':
+ builder = 'html'
+ elif target == 'pdf':
+ builder = 'xlatex'
+ elif target == 'xmospdf':
+ builder = 'xlatex'
+ os.environ['XMOSLATEX'] = '1'
+ elif target == 'xref':
+ builder = 'xmos_xref'
+ os.environ['XMOSLATEX'] = '1'
+ elif target == 'xmoshtml':
+ builder = 'xdehtml'
+ os.environ['USE_XDEONLY_HTML'] = "0"
+ elif target == 'xdehtml':
+ builder = 'xdehtml'
+ os.environ['USE_XDEONLY_HTML'] = "1"
+ elif target == 'xdetutorial':
+ builder = 'xdehtml'
+ os.environ['USE_XDEONLY_HTML'] = "1"
+ os.environ['XDETUTORIAL_HTML'] = "1"
+ else:
+ sys.stderr.write("xdoc: Unknown target %s\n"%target)
+ exit(1)
+
+ toc = checktoc(config['SPHINX_MASTER_DOC']+".rst",
+ config['OTHER_DOC_DIRS'],
+ path=path)
+ if toc == []:
+ os.environ['XMOSCOMPACTPDF']='1'
+ else:
+ os.environ['XMOSMANUALPDF']='1'
+
+ config['TOC'] = toc
+
+ os.environ['COLLECTION'] = ' '.join([x + '__0' for x in toc])
+
+ os.environ['TEXINPUTS'] = os.path.join(config['XDOC_DIR'],'..','infr_docs','base')+":"
+ os.environ['TEXINPUTS'] += os.path.join(config['XDOC_DIR'],'texinput')+":"
+
+
+ os.environ['CURRENT_BUILDER'] = builder
+
+ if subdoc:
+ os.environ['_SPHINX_MASTER_DOC'] = subdoc
+ os.environ['COLLECTION'] = ''
+ else:
+ os.environ['_SPHINX_MASTER_DOC'] = config['SPHINX_MASTER_DOC']
+
+ build_dir = os.path.join(path,"_build",builder)
+ if os.path.exists(build_dir):
+ shutil.rmtree(build_dir)
+
+ os.makedirs(build_dir)
+
+ if target == 'xref':
+ print "Getting xref info"
+ else:
+ print "Running Sphinx"
+ filt = XSphinxFilter(sys.stdout, sys.stderr, os.path.join(build_dir,'sphinx.output'))
+ sys.stdout = filt
+ sys.stderr = filt
+
+ sphinx.main(['sphinx-build',
+ '-c',os.path.join(config['XDOC_DIR'],'xsphinx'),
+ '-b',builder,
+ path,
+ os.path.join(path,"_build",builder)])
+ sys.stdout, sys.stderr = filt.finish()
+
+ if builder == 'xlatex':
+ doLatex(path,
+ os.path.join(path,"_build",builder),
+ config,
+ config['SPHINX_MASTER_DOC'],
+ xmoslatex = target in xmos_targets)
+
+ if target != 'xref':
+ print "Build Complete"
+
+xmos_targets = ['xmoshtml','xdehtml','xmospdf','issue','draft','xref']
+
+
+def main(target,path='.'):
+ print "Building documentation target: %s" % target
+ if target in ['issue','draft']:
+ config = prebuild(path,xmos_prebuild=True, xmos_publish=True)
+ build(path,config,target='xref')
+ for x in config['TOC']:
+ build(path,config,target='xref',subdoc=x)
+ build(path,config,target='xdehtml')
+ build(path,config,target='xmospdf')
+ else:
+ config = prebuild(path,xmos_prebuild=(target in xmos_targets))
+ build(path,config,target=target)
+
+ if target in ['issue','draft','pubdraft','pubissue']:
+ make_zip(path, config)
+
+ if target in ['issue','draft']:
+ from xmossphinx.upload_issue import upload
+ upload(path,is_draft=(target==['draft']))
+
+if __name__ == "__main__":
+ target = sys.argv[1]
+ main(target)
View
2  xsphinx/Doxyfile
@@ -574,7 +574,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = --INPUT--
+INPUT = .doxygen
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
View
94 xsphinx/check_toc.py
@@ -3,49 +3,57 @@
import sys
import re
-explicit_title_re = re.compile(r'^(.+?)\s*(?<!\x00)<(.*?)>$', re.DOTALL)
-
-paths = ['.']
-
-master = sys.argv[1] + '.rst'
-docnum = sys.argv[2]
-webgen = (sys.argv[3] == '1')
-search_paths = ['.']
-if len(sys.argv) > 4:
- for path in sys.argv[4:]:
- path = os.path.join('.linked_dirs',os.path.basename(os.path.abspath(path)))
- search_paths.append(path)
-
-
-f = open(master);lines = f.readlines();f.close()
-
-toc = []
-in_toc = False
-toc_indent = None
-for line in lines:
- if line[0:12] == '.. toctree::':
- in_toc = True
- elif in_toc and line != '\n':
- indent = len(re.match('( *)',line).groups(0)[0])
- if not toc_indent:
- toc_indent = indent
- if indent != toc_indent:
- break
-
- line = line.strip()
- m = re.match('.*:part:(.*)',line)
- if m:
- continue
- m = explicit_title_re.match(line)
- if m:
- line = m.group(2)
- toc.append(line)
-
-
-i = 0
-for entry in toc:
- print entry + "___%s" % i
- i += 1
+
+def checktoc(master, linked_dirs = None, path='.'):
+ explicit_title_re = re.compile(r'^(.+?)\s*(?<!\x00)<(.*?)>$', re.DOTALL)
+ paths = [path]
+ search_paths = [path]
+ if linked_dirs:
+ for path in linked_dirs:
+ path = os.path.join('.linked_dirs',os.path.basename(os.path.abspath(path)))
+ search_paths.append(path)
+
+ f = open(os.path.join(path,master));lines = f.readlines();f.close()
+
+ toc = []
+ in_toc = False
+ toc_indent = None
+ for line in lines:
+ if line[0:12] == '.. toctree::':
+ in_toc = True
+ elif in_toc and line != '\n':
+ indent = len(re.match('( *)',line).groups(0)[0])
+ if not toc_indent:
+ toc_indent = indent
+ if indent != toc_indent:
+ break
+
+ line = line.strip()
+ m = re.match('.*:part:(.*)',line)
+ if m:
+ continue
+ m = explicit_title_re.match(line)
+ if m:
+ line = m.group(2)
+ toc.append(line)
+
+ return toc
+
+if __name__ == "__main__":
+ master = sys.argv[1] + '.rst'
+ docnum = sys.argv[2]
+ webgen = (sys.argv[3] == '1')
+
+ toc = checktoc(master)
+ i = 0
+ for entry in toc:
+ print entry + "___%s" % i
+ i += 1
+
+
+
+
+
View
16 xsphinx/conf.py
@@ -11,11 +11,13 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
+
import sys, os, re
from xsphinx.builders.xlatex import XLaTeXBuilder, xlatex_rearrange_tocs
import xsphinx.code
import xsphinx.images
-import xcomment, srcfile
+import xcomment
+import srcfile
import docutils
from docutils import nodes
import xroles
@@ -103,9 +105,9 @@
# built documents.
#
# The short X.Y version.
-version = os.environ['VERSION']
+version = ''#os.environ['VERSION']
# The full version, including alpha/beta/rc tags.
-release = os.environ['VERSION']
+release = ''#os.environ['VERSION']
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -188,7 +190,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+html_static_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
@@ -266,7 +268,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
- (master_doc, short_name + '.tex', os.environ['SPHINX_PROJECT_NAME'],
+ (master_doc, short_name + '.tex', '', #os.environ['SPHINX_PROJECT_NAME'],
u'', 'manual'),
]
@@ -301,7 +303,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', short_name, os.environ['SPHINX_PROJECT_NAME'] ,
+ ('index', short_name, '',#os.environ['SPHINX_PROJECT_NAME'] ,
[u'XCore'], 1)
]
@@ -430,8 +432,10 @@ def setup(app):
xcomment.setup(app, enable_comments)
+
try:
__import__('xmosconf')
+ extraconf_modules.add('xmosconf')
except:
pass
View
46 xsphinx/run_latex.py
@@ -1,31 +1,35 @@
#!/usr/bin/python
-
import sys
import subprocess
import re
-cmd = ['pdflatex'] + sys.argv[1:]
+def runlatex(path,args):
+ cmd = ['pdflatex'] + args
+
+ n = 1
+ while True:
+ print >>sys.stderr, "Running Latex %d" % n
+ n=n+1
+ process = subprocess.Popen(cmd,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ cwd=path)
+ lines = process.stdout.readlines()
-n = 1
-while True:
- print >>sys.stderr, "Running Latex %d" % n
- n=n+1
- process = subprocess.Popen(cmd,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
- lines = process.stdout.readlines()
+ found_rerun = False
+ for line in lines:
+ #print >>sys.stderr,line
+ if re.match('.*[rR]e-?run to get.*',line):
+ found_rerun = True
- found_rerun = False
- for line in lines:
- #print >>sys.stderr,line
- if re.match('.*[rR]e-?run to get.*',line):
- found_rerun = True
+ if not found_rerun:
+ break
- if not found_rerun:
- break
+ for i in range(len(lines)):
+ if lines[i][0] == '!':
+ print >>sys.stderr,''.join(lines[i:i+6])
-for i in range(len(lines)):
- if lines[i][0] == '!':
- print >>sys.stderr,''.join(lines[i:i+6])
+ return (lines)
-print ''.join(lines)
+if __name__ == "__main__":
+ print ''.join(runlatex('.',sys.argv[1:]))
View
82 xsphinx/sphinx_filter.py
@@ -1,42 +1,66 @@
import sys
import re
-output = False
-seen_exception = False
-seen_debug = False
-while True:
- line = sys.stdin.readline()
- if line == '':
- break
+class XSphinxFilter(object):
- if re.match('Exception.*',line) or re.match('Configuration error.*',line):
- seen_exception = True
+ def __init__(self, stdout, stderr, logfile_path):
+ self.output = False
+ self.seen_exception = False
+ self.seen_debug = False
+ self.stdout = stdout
+ self.stderr = stderr
+ self.logfile = open(logfile_path,"w")
+ self.logfile_path = logfile_path
- if re.match('.*DEBUG.*',line):
- seen_debug = True
+ def finish(self):
+ self.logfile.close()
+ if self.output:
+ self.stdout.write("Full details of errors/warnings can be found in %s\n" % self.logfile_path)
- if seen_exception or seen_debug:
- sys.stdout.write(line)
- continue
+ return self.stdout, self.stderr
- if not (re.match('.*WARNING.*',line) or \
- re.match('.*ERROR.*',line) or \
- re.match('.*SEVERE.*',line)):
- continue
+ def flush(self):
+ self.stdout.flush()
- if re.match('.*included in any toctree.*',line):
- continue
+ def write(self, line):
+ self.logfile.write(line)
+# self.stdout.write(line)
+# return
+ if re.match('Exception.*',line) or re.match('IOError.*',line) or re.match('Configuration error.*',line):
+ self.seen_exception = True
- m = re.match(r'.*/([^/:]*):(.*)', line)
+ if re.match('.*DEBUG.*',line):
+ self.seen_debug = True
- if m:
- line = '%s:%s\n' % (m.groups(0)[0],m.groups(0)[1])
+ if self.seen_exception or self.seen_debug:
+ self.stdout.write(line)
+ return
- output = True
- sys.stdout.write(line)
+ if not (re.match('.*WARNING.*',line) or \
+ re.match('.*ERROR.*',line) or \
+ re.match('.*SEVERE.*',line)):
+ return
-if output:
- print "Full details of errors/warnings can be found in _build/.../sphinx.STDERR"
+ if re.match('.*included in any toctree.*',line):
+ return
-if seen_exception:
- exit(1)
+ m = re.match(r'.*/([^/:]*):(.*)', line)
+
+ if m:
+ line = '%s:%s\n' % (m.groups(0)[0],m.groups(0)[1])
+
+ self.output = True
+ self.stdout.write(line)
+
+
+
+if __name__ == "__main__":
+ filt = XSphinxFilter(sys.stdout,sys.stderr,sys.argv[1])
+ while True:
+ line = sys.stdin.readline()
+ if line == '':
+ break
+ filt.write(line)
+ filt.finish()
+ if filt.seen_exception:
+ exit(1)
Please sign in to comment.
Something went wrong with that request. Please try again.