Update config

Make all paths in the config file relative to the home directory.
This commit is contained in:
Raphaël Vinot 2014-08-20 16:00:56 +02:00
parent a68f5b6a0e
commit 50cfac857e
5 changed files with 12 additions and 9 deletions

View file

@ -67,7 +67,7 @@ if __name__ == "__main__":
time.sleep(10) time.sleep(10)
continue continue
# Creating the full filepath # Creating the full filepath
filename = os.path.join(os.environ('AIL_BIN'), filename = os.path.join(os.environ('AIL_HOME'),
h.config.get("Directories", "pastes"), paste) h.config.get("Directories", "pastes"), paste)
dirname = os.path.dirname(filename) dirname = os.path.dirname(filename)
if not os.path.exists(dirname): if not os.path.exists(dirname):

View file

@ -27,6 +27,7 @@ import time
from packages import Paste from packages import Paste
from pubsublogger import publisher from pubsublogger import publisher
from packages import lib_words from packages import lib_words
import os
import Helper import Helper
@ -52,8 +53,10 @@ if __name__ == "__main__":
publisher.info("Script Curve subscribed to {}".format(h.sub_channel)) publisher.info("Script Curve subscribed to {}".format(h.sub_channel))
# FILE CURVE SECTION # # FILE CURVE SECTION #
csv_path = h.config.get("Directories", "wordtrending_csv") csv_path = os.path.join(os.environ('AIL_HOME'),
wordfile_path = h.config.get("Directories", "wordsfile") h.config.get("Directories", "wordtrending_csv"))
wordfile_path = os.path.join(os.environ('AIL_HOME'),
h.config.get("Directories", "wordsfile"))
message = h.redis_rpop() message = h.redis_rpop()
prec_filename = None prec_filename = None

View file

@ -54,7 +54,7 @@ if __name__ == "__main__":
h.config.get("PubSub_Global", "channel"))) h.config.get("PubSub_Global", "channel")))
set_limit = 100 set_limit = 100
bloompath = os.path.join(os.environ('AIL_BIN'), bloompath = os.path.join(os.environ('AIL_HOME'),
h.config.get("Directories", "bloomfilters")) h.config.get("Directories", "bloomfilters"))
bloop_path_set = set() bloop_path_set = set()

View file

@ -27,7 +27,7 @@ cfg = ConfigParser.ConfigParser()
cfg.read(configfile) cfg.read(configfile)
# Indexer configuration - index dir and schema setup # Indexer configuration - index dir and schema setup
indexpath = cfg.get("Indexer", "path") indexpath = os.path.join(os.environ('AIL_HOME'), cfg.get("Indexer", "path"))
indexertype = cfg.get("Indexer", "type") indexertype = cfg.get("Indexer", "type")
argParser = argparse.ArgumentParser(description='Fulltext search for AIL') argParser = argparse.ArgumentParser(description='Fulltext search for AIL')

View file

@ -1,8 +1,8 @@
[Directories] [Directories]
bloomfilters = /home/user/Blooms/ bloomfilters = Blooms
pastes = PASTES pastes = PASTES
wordtrending_csv = /home/user/AIL/var/www/static/csv/wordstrendingdata wordtrending_csv = var/www/static/csv/wordstrendingdata
wordsfile = /home/user/AIL/files/wordfile wordsfile = files/wordfile
##### Redis ##### ##### Redis #####
[Redis_Cache] [Redis_Cache]
@ -70,4 +70,4 @@ cc_critical = DE
# Indexer configuration # Indexer configuration
[Indexer] [Indexer]
type = whoosh type = whoosh
path = /home/user/indexdir path = indexdir