def main(): """ Main function for recipy command-line script """ args = docopt(__doc__, version='recipy v%s' % __version__) if args['--debug']: print('Command-line arguments: ') print(args) print('DB path: ', config.get_db_path()) print('') print('Full config file (as interpreted):') print('----------------------------------') conf = config.read_config_file() s = six.StringIO() conf.write(s) print(s.getvalue()) print('----------------------------------') if args['search']: search(args) elif args['latest']: latest(args) elif args['gui']: gui(args)
def main(): """ Main function for recipy command-line script """ args = docopt(__doc__, version='recipy v%s' % __version__) if args['--debug']: print('Command-line arguments: ') print(args) print('DB path: ', config.get_db_path()) print('') print('Full config file (as interpreted):') print('----------------------------------') conf = config.read_config_file() s = six.StringIO() conf.write(s) print(s.getvalue()) print('----------------------------------') if args['search']: search(args) elif args['latest']: latest(args) elif args['gui']: gui(args) elif args['annotate']: annotate(args) elif args['pm']: patched_modules(args)
def add_module_to_db(modulename, input_functions, output_functions, db_path=get_db_path()): db = open_or_create_db(path=db_path) patches = db.table('patches') patches.insert({'modulename': modulename, 'input_functions': input_functions, 'output_functions': output_functions}) db.close()
def add_module_to_db(modulename, input_functions, output_functions, db_path=get_db_path()): db = open_or_create_db(path=db_path) patches = db.table('patches') patches.insert({ 'modulename': modulename, 'input_functions': input_functions, 'output_functions': output_functions }) db.close()
def main(): """ Main function for recipy command-line script """ args = docopt(__doc__, version='recipy v%s' % __version__) if args['--debug']: print('Command-line arguments: ', args) print('DB path: ', config.get_db_path()) if args['search']: search(args) elif args['gui']: gui(args)
from flask import Flask, url_for import os from flask_bootstrap import Bootstrap import re from time import strptime, strftime from recipyCommon.config import get_db_path recipyGui = Flask(__name__) recipyGui.config['SECRET_KEY'] = 'geheim' recipyGui.config['tinydb'] = get_db_path() Bootstrap(recipyGui) # Function to easily find your assets # In your template use <link rel=stylesheet href="{{ static('filename') }}"> recipyGui.jinja_env.globals['static'] = ( lambda filename: url_for('static', filename = filename) ) def register_blueprints(app): # Prevents circular imports from recipyGui.views import routes recipyGui.register_blueprint(routes) register_blueprints(recipyGui) # Custom filters @recipyGui.template_filter() def highlight(text, query=None): """Filter to highlight query terms in search results."""
from flask import Flask, url_for from flask_bootstrap import Bootstrap import re from time import strptime, strftime from os.path import abspath from recipyCommon.config import get_db_path recipyGui = Flask(__name__) recipyGui.jinja_env.add_extension('jinja2.ext.do') recipyGui.config['SECRET_KEY'] = 'geheim' recipyGui.config['tinydb'] = abspath(get_db_path()) Bootstrap(recipyGui) # Function to easily find your assets # In your template use <link rel=stylesheet href="{{ static('filename') }}"> recipyGui.jinja_env.globals['static'] = ( lambda filename: url_for('static', filename=filename)) def register_blueprints(app): # Prevents circular imports from recipyGui.views import routes recipyGui.register_blueprint(routes) register_blueprints(recipyGui) # Custom filters