Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
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()
Exemple #4
0
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()
Exemple #5
0
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)
Exemple #6
0
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."""
Exemple #7
0
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