예제 #1
0
파일: recipycmd.py 프로젝트: oew1v07/recipy
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)
예제 #2
0
파일: recipycmd.py 프로젝트: yaoy123/recipy
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)
예제 #3
0
파일: log.py 프로젝트: pablo-esteban/recipy
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()
예제 #4
0
파일: log.py 프로젝트: yaoy123/recipy
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()
예제 #5
0
파일: recipycmd.py 프로젝트: kynan/recipy
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)
예제 #6
0
파일: __init__.py 프로젝트: cash/recipy
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."""
예제 #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