# Path: recruit_app/app.py
# def create_app(config_object=ProdConfig):
#     '''An application factory, as explained here:
#         http://flask.pocoo.org/docs/patterns/appfactories/
# 
#     :param config_object: The configuration object to use.
#     '''
#     app = Flask(__name__)
#     app.config.from_object(config_object)
#     register_extensions(app)
#     register_blueprints(app)
#     register_errorhandlers(app)
#     admin = Admin()
#     register_admin(admin, db)
#     # register_search(app)
#     admin.init_app(app)
#     # admin needs to be initialized oddly for tests to work.
#     register_tasks()
# 
#     return app
# 
# Path: recruit_app/settings.py
# class DevConfig(Config):
#     """Development configuration."""
#     ENV = 'dev'
#     DEBUG = True
#     #DB_NAME = 'dev.db'
#     # Put the db file in project root
#     #DB_PATH = os.path.join(Config.PROJECT_ROOT, DB_NAME)
#     SQLALCHEMY_DATABASE_URI = os_env.get('DATABASE_URL', 'postgresql://recruit@localhost:5432/recruit')
#     #SQLALCHEMY_DATABASE_URI = 'sqlite:///{0}'.format(DB_PATH)
#     WHOOSH_BASE = os.path.join(basedir, 'search.db')
#     #DEBUG_TB_ENABLED = True
#     ASSETS_DEBUG = True  # Don't bundle/minify static assets
#     CACHE_TYPE = 'simple'  # Can be "memcached", "redis", etc.
# 
# class ProdConfig(Config):
#     """Production configuration."""
#     ENV = 'prod'
#     DEBUG = False
#     SQLALCHEMY_DATABASE_URI = os_env.get('DATABASE_URL', 'postgresql://recruit@localhost:5432/recruit')
#     DEBUG_TB_ENABLED = False  # Disable Debug toolbar
#     WHOOSH_BASE = os.path.join(basedir, 'search.db')


import argparse
import urlparse
import sys
import os
from redis import Redis
from rq_scheduler.scheduler import Scheduler
from recruit_app.app import create_app
from recruit_app.settings import DevConfig, ProdConfig
from rq.logutils import setup_loghandlers
#!/usr/bin/env python






def main():
    parser = argparse.ArgumentParser(description='Runs RQ scheduler')
    parser.add_argument('-H', '--host',
                        default=os.environ.get('RQ_REDIS_HOST', 'localhost'),
                        help="Redis host")
    parser.add_argument('-p', '--port',
                        default=int(os.environ.get('RQ_REDIS_PORT', 6379)),
                        type=int,
                        help="Redis port number")
    parser.add_argument('-d', '--db',
                        default=int(os.environ.get('RQ_REDIS_DB', 0)),
                        type=int, help="Redis database")
    parser.add_argument('-P', '--password',
                        default=os.environ.get('RQ_REDIS_PASSWORD'),
                        help="Redis password")
    parser.add_argument('--verbose', '-v',
                        action='store_true',
                        default=False,

# Path: recruit_app/app.py
# def create_app(config_object=ProdConfig):
#     '''An application factory, as explained here:
#         http://flask.pocoo.org/docs/patterns/appfactories/
# 
#     :param config_object: The configuration object to use.
#     '''
#     app = Flask(__name__)
#     app.config.from_object(config_object)
#     register_extensions(app)
#     register_blueprints(app)
#     register_errorhandlers(app)
#     admin = Admin()
#     register_admin(admin, db)
#     # register_search(app)
#     admin.init_app(app)
#     # admin needs to be initialized oddly for tests to work.
#     register_tasks()
# 
#     return app
# 
# Path: recruit_app/settings.py
# class DevConfig(Config):
#     """Development configuration."""
#     ENV = 'dev'
#     DEBUG = True
#     #DB_NAME = 'dev.db'
#     # Put the db file in project root
#     #DB_PATH = os.path.join(Config.PROJECT_ROOT, DB_NAME)
#     SQLALCHEMY_DATABASE_URI = os_env.get('DATABASE_URL', 'postgresql://recruit@localhost:5432/recruit')
#     #SQLALCHEMY_DATABASE_URI = 'sqlite:///{0}'.format(DB_PATH)
#     WHOOSH_BASE = os.path.join(basedir, 'search.db')
#     #DEBUG_TB_ENABLED = True
#     ASSETS_DEBUG = True  # Don't bundle/minify static assets
#     CACHE_TYPE = 'simple'  # Can be "memcached", "redis", etc.
# 
# class ProdConfig(Config):
#     """Production configuration."""
#     ENV = 'prod'
#     DEBUG = False
#     SQLALCHEMY_DATABASE_URI = os_env.get('DATABASE_URL', 'postgresql://recruit@localhost:5432/recruit')
#     DEBUG_TB_ENABLED = False  # Disable Debug toolbar
#     WHOOSH_BASE = os.path.join(basedir, 'search.db')


# Path: run_scheduler.py
import argparse
import urlparse
import sys
import os
from redis import Redis
from rq_scheduler.scheduler import Scheduler
from recruit_app.app import create_app
from recruit_app.settings import DevConfig, ProdConfig
from rq.logutils import setup_loghandlers

#!/usr/bin/env python






def main():
    parser = argparse.ArgumentParser(description='Runs RQ scheduler')
    parser.add_argument('-H', '--host',
                        default=os.environ.get('RQ_REDIS_HOST', 'localhost'),
                        help="Redis host")
    parser.add_argument('-p', '--port',
                        default=int(os.environ.get('RQ_REDIS_PORT', 6379)),
                        type=int,
                        help="Redis port number")
    parser.add_argument('-d', '--db',
                        default=int(os.environ.get('RQ_REDIS_DB', 0)),
                        type=int, help="Redis database")
    parser.add_argument('-P', '--password',
                        default=os.environ.get('RQ_REDIS_PASSWORD'),
                        help="Redis password")
    parser.add_argument('--verbose', '-v',
                        action='store_true',
                        default=False,

                        help='Show more output')