Changeset - a79eccfd96af
[Not reviewed]
version_5
0 1 0
Dennis Fink - 9 years ago 2015-10-14 00:56:10
dennis.fink@c3l.lu
Fix checkers in manage.py
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
manage.py
Show inline comments
 
@@ -5,48 +5,48 @@ import os.path
 

	
 
from flask import current_app
 
from flask.ext.script import Manager
 
from flask.ext.script.commands import Clean, ShowUrls
 

	
 
from ennstatus import create_app
 

	
 
manager = Manager(create_app())
 

	
 

	
 
@manager.command
 
def dumpconfig():
 
    """Show config."""
 

	
 
    pprint.pprint(current_app.config)
 

	
 

	
 
def checkers(checker):
 

	
 
    def get_files(root, files):
 
        for f in files:
 
            if os.path.splitext(f)[1] == '.py':
 
                yield os.path.join(root, f)
 

	
 
    for root, dirs, files in os.walk('./'):
 
    for root, dirs, files in os.walk('../'):
 
        for f in get_files(root, files):
 
            subprocess.call([checker, f])
 

	
 

	
 
@manager.command
 
def pep8():
 
    """Check all py files for pep8 compat."""
 

	
 
    checkers('pep8')
 

	
 

	
 
@manager.command
 
def pep257():
 
    """Check all py files for pep257 compat."""
 

	
 
    checkers('pep257')
 

	
 

	
 
manager.add_command('clean', Clean())
 
manager.add_command('urls', ShowUrls())
 

	
 
if __name__ == "__main__":
 
    manager.run()
0 comments (0 inline, 0 general)