Boost logo

Boost-Commit :

From: srajko_at_[hidden]
Date: 2007-06-15 01:07:40


Author: srajko
Date: 2007-06-15 01:07:40 EDT (Fri, 15 Jun 2007)
New Revision: 7055
URL: http://svn.boost.org/trac/boost/changeset/7055

Log:
add fignore option, fix ignore bug

Text files modified:
   sandbox/template_under_construction/make_template.py | 20 ++++++++++++++++----
   1 files changed, 16 insertions(+), 4 deletions(-)

Modified: sandbox/template_under_construction/make_template.py
==============================================================================
--- sandbox/template_under_construction/make_template.py (original)
+++ sandbox/template_under_construction/make_template.py 2007-06-15 01:07:40 EDT (Fri, 15 Jun 2007)
@@ -57,6 +57,7 @@
         # initialize self.options
         self.options = dict()
         self.options['ignore']=list()
+ self.options['fignore']=list()
         
         # initialize common regular expressions
         self.any = re.compile(r'.*\Z')
@@ -254,6 +255,7 @@
         self.directory = self.options.get('template')
         self.into = self.options.get('into',None,'')
         ignore_list = self.options.get('ignore')
+ fignore_list = self.options.get('fignore')
         
         cwd = os.getcwd()
         os.chdir(self.directory)
@@ -275,6 +277,14 @@
             for name in files:
                 if name.startswith('.'):
                     continue
+ fignored=False
+ for item in fignore_list:
+ if name.endswith(item):
+ fignored=True
+ break
+ if fignored:
+ continue
+
                 pathname = (os.path.join(root, name))
                 if name.endswith('.py'):
                     content = self.read_content(os.path.join(root, name))
@@ -453,9 +463,9 @@
 
 # reads options from the command line
 # command line has the format:
-# python make_template.py ((option=value )* (template))* (option=value)*
-# options specified immediately before a template are for that template only.
-# options specified at the end are for all templates.
+# python make_template.py (option=value)* ((template) (option=value)*)*
+# options specified immediately after a template are for that template only.
+# options specified at the beginning are for all templates.
 def process_command_line():
     templates = list()
     templates.append(Template())
@@ -481,7 +491,9 @@
         if global_options.count(option)>0:
             options.options[option] = val
         elif option == 'ignore':
- templates[index].options.options[option].add(os.path.normpath(val))
+ templates[index].options.options[option].append(os.path.normpath(val))
+ elif option == 'fignore':
+ templates[index].options.options[option].append(val)
         else:
             templates[index].options.options[option] = val
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk