Commits

Pablo Caro Revuelta committed 0312b37

__init__ is now pep8 compliant.

Remove some unused like glob import and get_files_to_process function

Comments (0)

Files changed (1)

src/tacot/__init__.py

 # -*- coding: utf-8 -*-
-import os, glob, shutil
+import os
+import shutil
 import time
 import fnmatch
 import codecs
 
 from tacot.manifest import Manifest, findall
 
+
 def load_ignore(path):
     patterns = []
     if os.path.exists(path):
                 patterns.append(line)
 
         f.close()
-
     return patterns
 
-def get_files_to_process(root_path, ignore):
-    ignore.patterns.append('.*')
-    root_path_len = len(root_path)
-    for abs_path, dirnames, filenames in os.walk(root_path):
-        relative_path = abs_path[root_path_len:].strip('/')
-        for f in filenames:
-            abs_file_path = os.path.join(abs_path, f)
-            relative_file_path = os.path.join(relative_path, f)
-
-            if not ignore.is_match(abs_file_path, relative_file_path):
-                yield p
 
 class RootPath(object):
     def __init__(self, root_path):
     def __call__(self, path):
         return "/".join(self.root_path + [path.lstrip("/")])
 
+
 def file_to_process_iter(root_path, manifest_file_path):
     manifest = Manifest()
     manifest.findall(root_path.rstrip('/') + '/')
 
 LAST_MTIME = 0
 
+
 def files_changed(root_path, build_path):
     """Return True if the files have changed since the last check"""
 
         return True
     return False
 
+
 def process(root_path, build_path, manifest_file_path):
     template_lookup = TemplateLookup(directories=[root_path], output_encoding='utf-8', encoding_errors='replace')
 
         else:
             shutil.copy(source_filepath, dest_filepath)
 
+
 def main():
     parser = argparse.ArgumentParser(
         description="""A tool to generate a static web site, with Mako templates."""
         help="""Path where to find the content files"""
     )
     parser.add_argument(
-        "-o", "--output", 
+        "-o", "--output",
         dest="output", default=os.path.join(os.getcwd(), "_build"),
         help="""Where to output the generated files. If not specified, a directory """
              """will be created, named "_build" in the current path (_build by default)."""
         help="""Manifest config file (.manifest by default)"""
     )
     parser.add_argument(
-        "-r", "--autoreload", 
+        "-r", "--autoreload",
         dest="autoreload", action="store_true",
         help="Relaunch tacot each time a modification occurs on the content files"
     )
                         build_path,
                         manifest_file_path
                     )
-                    
+
                 time.sleep(.5)  # sleep to avoid cpu load
             except KeyboardInterrupt:
                 break