From a47b447f0f6b42bed48d272859e7b4a54a1324a0 Mon Sep 17 00:00:00 2001 From: Victor Lei Date: Sat, 19 Nov 2016 08:27:43 +0200 Subject: [PATCH] fixed --- smop/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/smop/main.py b/smop/main.py index 1230427a..3760ab04 100644 --- a/smop/main.py +++ b/smop/main.py @@ -19,8 +19,8 @@ def print_header(fp): print >> fp, "# Autogenerated with SMOP " + version.__version__ # print >> fp, "from __future__ import division" print >> fp, "from smop.core import *" - if options.link: - print >> fp, "from %s import *" % options.link + # if options.link: + # print >> fp, "from %s import *" % options.link print >> fp, "#", options.filename @@ -39,6 +39,8 @@ def main(): fp = open(options.output, "w") else: fp = None + if fp: + print_header(fp) if options.glob_pattern: options.filelist = fnmatch.filter(options.filelist, options.glob_pattern) @@ -72,6 +74,7 @@ def main(): if not options.output: f = splitext(basename(options.filename))[0] + ".py" with open(f, "w") as fp: + print_header(fp) fp.write(s) else: fp.write(s)