Show
Ignore:
Timestamp:
04/22/07 02:52:25 (2 years ago)
Author:
fredlin
Message:

templatebrowser: update for pep8

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/TemplateBrowser/trunk/templatebrowser/toolbox.py

    r2512 r2906  
    66 
    77class TemplateBrowser(controllers.Controller): 
    8     """Browse Templates.  
    9        Scans the project directories and  
     8    """Browse Templates. 
     9       Scans the project directories and 
    1010       collect your templates in single page. 
    1111    """ 
     
    1616    __copyright__ = "Copyright 2007 Fred Lin" 
    1717    __license__ = "MIT" 
    18      
     18 
    1919    baseTemplate = 'templatebrowser' 
    20     languages = None 
     20    #languages = None 
    2121    icon = "/tg_static/images/widgets.png" 
    2222    need_project = True 
    23  
    2423 
    2524    def __init__(self,currentProject=None): 
     
    3029    def project_files(self): 
    3130        """ 
    32         Walk through the directory, return the template name, path  
     31        Walk through the directory, return the template name, path 
    3332        """ 
    3433        p = turbogears.util.get_package_name() 
     
    4140                      'dir':os.path.dirname(dirpath), 
    4241                      'file_name':os.path.basename(dirpath), 
    43                       'path':dirpath,  
     42                      'path':dirpath, 
    4443                      'isdir':True, 
    4544                      'level':level 
     
    7574 
    7675        os.path.walk(p, collect_files, fl) 
    77         return [x for x in turbogears.util.flatten_sequence(fl)  
     76        return [x for x in turbogears.util.flatten_sequence(fl) 
    7877                if not x["isdir"] or visibility[x["path"]]] 
    79      
    80      
     78 
    8179    def index(self): 
    8280        return dict(project_files=self.project_files()) 
     
    9391                f=open(self.currentProject+'/'+file['path'],'r') 
    9492                #return dict(content = f.read()) 
    95                 return f.read()         
    96      
     93                return f.read() 
     94 
    9795    @turbogears.expose() 
    9896    def preview(self, filename): 
     
    108106        """ 
    109107        return self.render(filename, ContentType = 'text/plain') 
    110