Skip to content

Commit

Permalink
HH-37783 clean config files
Browse files Browse the repository at this point in the history
  • Loading branch information
SuminAndrew committed Nov 8, 2013
1 parent ae35c45 commit e5033a7
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 111 deletions.
2 changes: 1 addition & 1 deletion dev_run.py
Expand Up @@ -3,5 +3,5 @@

from frontik.server import main

if __name__ == "__main__":
if __name__ == '__main__':
main('./frontik_dev.cfg')
7 changes: 6 additions & 1 deletion docs/running.md
Expand Up @@ -6,7 +6,12 @@ Frontik application is easy to run:
frontik.server.main('/path/to/config.file')
```

All customization is made through config file. In the simplest case, you could leave it empty — there are sensible default values for all options.
All customization is made through config file. In the simplest case, you could leave it empty — there are sensible
default values for all options.

In development environment you can use [dev_run.py](dev_run.py) — a simple launcher, which uses ```frontik_dev.cfg```
as a config file, which you need to create or copy from [frontik_dev.cfg.ex](frontik_dev.cfg.ex). The sample of a
production config can be found in [production/frontik.cfg](production/frontik.cfg).

[Tornado-util][tornado_util] module is used internally to run Frontik application.

Expand Down
27 changes: 0 additions & 27 deletions frontik.cfg.ex

This file was deleted.

2 changes: 1 addition & 1 deletion frontik/options.py
Expand Up @@ -23,7 +23,7 @@
tornado.options.define('long_request_timeout', None, float)
tornado.options.define('kill_long_requests', False, bool)

tornado.options.define('executor_type', 'ioloop', str) # available options: 'threaded', 'ioloop'
tornado.options.define('executor_type', 'threaded', str) # available options: 'threaded', 'ioloop'
tornado.options.define('executor_pool_size', 1, int)
tornado.options.define('warn_no_jobs', True, bool)

Expand Down
11 changes: 6 additions & 5 deletions frontik/server.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import frontik_logging
# coding=utf-8

import logging
import sys

Expand All @@ -9,18 +9,19 @@

import frontik.app
import frontik.options
import frontik.frontik_logging as frontik_logging

log = logging.getLogger("frontik.server")
log = logging.getLogger('frontik.server')


def main(config_file="/etc/frontik/frontik.cfg"):
def main(config_file='/etc/frontik/frontik.cfg'):
tornado_util.server.bootstrap(config_file=config_file)
frontik_logging.bootstrap_all_logging()

try:
app = frontik.app.get_app(options.urls, options.apps)
except:
log.exception("failed to initialize frontik.app, quitting")
log.exception('failed to initialize frontik application, quitting')
sys.exit(1)

tornado_util.server.main(app)
7 changes: 0 additions & 7 deletions frontik_srv.py

This file was deleted.

5 changes: 0 additions & 5 deletions frontik_srv.sh

This file was deleted.

1 change: 1 addition & 0 deletions production/frontik.cfg
Expand Up @@ -44,5 +44,6 @@ kill_long_requests = False

log_blocked_ioloop_timeout = 2.0

executor_type = 'threaded'
executor_pool_size=3
warn_no_jobs = True
54 changes: 0 additions & 54 deletions run_frontik.sh

This file was deleted.

3 changes: 1 addition & 2 deletions scripts/frontik
Expand Up @@ -2,6 +2,5 @@
# -*- coding: utf-8 -*-
from frontik.server import main


if __name__ == "__main__":
if __name__ == '__main__':
main()
18 changes: 10 additions & 8 deletions setup.py
@@ -1,15 +1,17 @@
# coding=utf-8

from setuptools import setup

setup(
name="frontik",
version=__import__("frontik").__version__,
description="Frontik is an asyncronous Tornado-based application server",
long_description=open("README.md").read(),
url="https://github.com/hhru/frontik",
packages=["frontik", "frontik/testing", "frontik/testing/pages"],
scripts=["scripts/frontik"],
name='frontik',
version=__import__('frontik').__version__,
description='Frontik is an asyncronous Tornado-based application server',
long_description=open('README.md').read(),
url='https://github.com/hhru/frontik',
packages=['frontik', 'frontik/testing', 'frontik/testing/pages'],
scripts=['scripts/frontik'],
package_data={
"frontik": ["*.xsl"],
'frontik': ['*.xsl'],
},
install_requires=[
'lxml >= 2.2.8, < 2.3a',
Expand Down

0 comments on commit e5033a7

Please sign in to comment.