Permalink
Browse files

Change SETTINGS_PATH to CONFIG_PATH for better naming consistency.

  • Loading branch information...
brocaar committed Mar 15, 2013
1 parent bc0843a commit fee3764f4ccbd1586218ac241dc84f740f042c6e
Showing with 24 additions and 12 deletions.
  1. +1 −1 Makefile
  2. +10 −5 README.rst
  3. +2 −2 job_runner_worker/config.py
  4. +1 −1 job_runner_worker/tests/unit/test_config.py
  5. +10 −3 scripts/job_runner_worker
View
@@ -7,7 +7,7 @@ pep8:
unittest: clean-pyc
coverage erase
- SETTINGS_PATH='.' coverage run --include "job_runner_worker*" --omit "*test*" -m unittest2 discover
+ CONFIG_PATH='.' coverage run --include "job_runner_worker*" --omit "*test*" -m unittest2 discover
coverage report
test: pep8 unittest
View
@@ -20,8 +20,11 @@ Requirements (depending on your distro, the naming might be a bit different):
* ``build-essential``
* ``libevent-dev``
-Then install this package by executing ``python setup.py install`` or
-``python setup.py develop`` (for development). In the latter, you might want
+Then you should be able to install this package with
+``pip install job-runner-worker``.
+
+If you want to install this package in development mode, clone this repository
+and then execute ``python setup.py develop``. In the latter, you might want
to install the testing requirements by executing
``pip install -r test-requirements.txt``.
@@ -107,13 +110,13 @@ For starting the worker, you can use the ``job_runner_worker`` command::
usage: job_runner_worker [-h] [--config-path CONFIG_PATH]
- Job Runner worker
+ Job Runner wormake teker (v2.0.0)
optional arguments:
-h, --help show this help message and exit
--config-path CONFIG_PATH
- absolute path to config file (default: SETTINGS_PATH
- env variable)
+ absolute path to config file (default: CONFIG_PATH env
+ variable)
Changes
@@ -124,6 +127,8 @@ v2.0.0
* Make the worker compatible with the new worker-pool structure.
**IMPORTANT:** This version is dependent on ``job-runner>=2.0.0``!
+* Change ``SETTINGS_PATH`` environment variable to ``CONFIG_PATH`` for better
+ naming consistency.
v1.2.1
@@ -7,7 +7,7 @@ def get_config_parser():
"""
Return ``ConfigParser`` instance and load config file.
- This will load the settings as specified in the ``SETTINGS_PATH``
+ This will load the settings as specified in the ``CONFIG_PATH``
environment variable.
:return:
@@ -26,7 +26,7 @@ def get_config_parser():
'broadcaster_server_port': '5556',
'reconnect_after_inactivity': str(60 * 10),
})
- config.read(os.environ['SETTINGS_PATH'])
+ config.read(os.environ['CONFIG_PATH'])
return config
@@ -15,7 +15,7 @@ def test_get_config_parser(self, os, ConfigParser):
"""
Test :py:func:`.get_config_parser`.
"""
- os.environ = {'SETTINGS_PATH': '/path/to/settings'}
+ os.environ = {'CONFIG_PATH': '/path/to/settings'}
config_mock = Mock()
ConfigParser.ConfigParser.return_value = config_mock
View
@@ -5,21 +5,28 @@ from gevent import monkey; monkey.patch_all()
import argparse
import os
-parser = argparse.ArgumentParser(description='Job Runner worker')
+import job_runner_worker
+
+
+parser = argparse.ArgumentParser(
+ description='Job Runner worker (v{0})'.format(
+ job_runner_worker.__version__
+ )
+)
parser.add_argument(
'--config-path',
dest='config_path',
type=str,
default=None,
- help='absolute path to config file (default: SETTINGS_PATH env variable)',
+ help='absolute path to config file (default: CONFIG_PATH env variable)',
)
if __name__ == '__main__':
arg_obj = parser.parse_args()
if arg_obj.config_path:
- os.environ['SETTINGS_PATH'] = arg_obj.config_path
+ os.environ['CONFIG_PATH'] = arg_obj.config_path
from job_runner_worker.config import config, setup_log_handler
from job_runner_worker.runner import run

0 comments on commit fee3764

Please sign in to comment.