Skip to content

Commit

Permalink
Merge branch 'fix_run_apprecommender' into 'master'
Browse files Browse the repository at this point in the history
Fix run apprecommender

- Set default base_dir to /var/lib/apprecommender
- Add script to run on development

See merge request !37
  • Loading branch information
LucianoPC committed Aug 17, 2016
2 parents a630f07 + e8619bd commit c7a180c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
before_script:
- ./install_dependencies.sh
- sudo pip2 install flake8
- /usr/bin/python2 -m apprecommender.main.cli --init
- /usr/bin/python2 -m apprecommender.main.cli --train
- sudo /usr/bin/python2 -m apprecommender.main.cli --init
- sudo /usr/bin/python2 -m apprecommender.main.cli --train

test:
script:
Expand Down
6 changes: 3 additions & 3 deletions apprecommender/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ def __init__(self):
['/etc/apprecommender/recommender.conf',
os.path.expanduser('~/.app_recommender.rc'),
os.path.expanduser('app_recommender.cfg')])
self.home_dir = os.path.expanduser('~/.app-recommender')
self.home_dir = os.path.expanduser('~/.apprecommender')

except (MissingSectionHeaderError), err:
logging.error("Error in config file syntax: %s", str(err))
os.abort()
if not hasattr(self, 'initialized'):
# data_source options
self.base_dir = os.environ.get(
'APPREC_DATA', '~/.apprecommender')
'APPREC_DATA', '/var/lib/apprecommender')
self.base_dir = os.path.expanduser(self.base_dir)
self.output = os.path.join(self.home_dir, 'apprec.log')
self.user_data_dir = os.path.join(self.base_dir, "user_data/")
Expand Down Expand Up @@ -129,7 +129,7 @@ def load_config_file(self):
self.debug = int(self.read_option('general', 'debug'))
self.debug = int(self.read_option('general', 'verbose'))
self.base_dir = os.environ.get(
'APPREC_DATA', '~/.apprecommender')
'APPREC_DATA', '/var/lib/apprecommender')
self.base_dir = os.path.expanduser(self.base_dir)
self.output = os.path.join(
self.home_dir, self.read_option('data_sources',
Expand Down
3 changes: 3 additions & 0 deletions run_from_source
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

APPREC_DATA=~/.apprecommender python -m apprecommender.main.cli $@

0 comments on commit c7a180c

Please sign in to comment.