Commit 96e36f1c67cf44bdc8d2c11a8b1a6709b285acc3
1 parent
e6bf05b1
Exists in
master
and in
1 other branch
Added clustering options to config.
Showing
1 changed file
with
8 additions
and
2 deletions
Show diff stats
src/config.py
@@ -43,6 +43,7 @@ class Config(): | @@ -43,6 +43,7 @@ class Config(): | ||
43 | self.axi_values = "/var/lib/apt-xapian-index/values" | 43 | self.axi_values = "/var/lib/apt-xapian-index/values" |
44 | self.popcon_index = "~/.app-recommender/popcon_index" | 44 | self.popcon_index = "~/.app-recommender/popcon_index" |
45 | self.popcon_dir = "~/.app-recommender/popcon_dir" | 45 | self.popcon_dir = "~/.app-recommender/popcon_dir" |
46 | + self.clusters_dir = "~/.app-recommender/clusters_dir" | ||
46 | self.strategy = "ct" # defaults to the cheapest one | 47 | self.strategy = "ct" # defaults to the cheapest one |
47 | self.reindex = 0 | 48 | self.reindex = 0 |
48 | self.load_options() | 49 | self.load_options() |
@@ -66,6 +67,7 @@ class Config(): | @@ -66,6 +67,7 @@ class Config(): | ||
66 | print " -a, --axi=PATH Path to Apt-xapian-index." | 67 | print " -a, --axi=PATH Path to Apt-xapian-index." |
67 | print " -p, --popconindex=PATH Path to popcon dedicated index." | 68 | print " -p, --popconindex=PATH Path to popcon dedicated index." |
68 | print " -m, --popcondir=PATH Path to popcon submissions dir." | 69 | print " -m, --popcondir=PATH Path to popcon submissions dir." |
70 | + print " -l, --clustersdir=PATH Path to popcon clusters dir." | ||
69 | print " -s, --strategy=OPTION Recommendation strategy." | 71 | print " -s, --strategy=OPTION Recommendation strategy." |
70 | print "" | 72 | print "" |
71 | print " [ strategy options ] " | 73 | print " [ strategy options ] " |
@@ -110,11 +112,13 @@ class Config(): | @@ -110,11 +112,13 @@ class Config(): | ||
110 | self.axi = self.read_option('recommender', 'axi') | 112 | self.axi = self.read_option('recommender', 'axi') |
111 | self.popcon_index = self.read_option('recommender', 'popcon_index') | 113 | self.popcon_index = self.read_option('recommender', 'popcon_index') |
112 | self.popcon_dir = self.read_option('recommender', 'popcon_dir') | 114 | self.popcon_dir = self.read_option('recommender', 'popcon_dir') |
115 | + self.clusters_dir = self.read_option('recommender', 'clusters_dir') | ||
113 | 116 | ||
114 | short_options = "hdvo:c:t:i:ra:p:m:s:" | 117 | short_options = "hdvo:c:t:i:ra:p:m:s:" |
115 | long_options = ["help", "debug", "verbose", "output=", "config=", | 118 | long_options = ["help", "debug", "verbose", "output=", "config=", |
116 | "tagsdb=", "tagsindex=", "reindex", "axi=", | 119 | "tagsdb=", "tagsindex=", "reindex", "axi=", |
117 | - "popconindex=", "popcondir=", "strategy="] | 120 | + "popconindex=", "popcondir=", "clustersdir=", |
121 | + "strategy="] | ||
118 | try: | 122 | try: |
119 | opts, args = getopt.getopt(sys.argv[1:], short_options, | 123 | opts, args = getopt.getopt(sys.argv[1:], short_options, |
120 | long_options) | 124 | long_options) |
@@ -147,7 +151,9 @@ class Config(): | @@ -147,7 +151,9 @@ class Config(): | ||
147 | self.axi_values = p + "/values" | 151 | self.axi_values = p + "/values" |
148 | elif o in ("-p", "--popconindex"): | 152 | elif o in ("-p", "--popconindex"): |
149 | self.popcon_index = p | 153 | self.popcon_index = p |
150 | - elif o in ("-p", "--popcondir"): | 154 | + elif o in ("-m", "--popcondir"): |
155 | + self.popcon_dir = p | ||
156 | + elif o in ("-l", "--clustersdir"): | ||
151 | self.popcon_dir = p | 157 | self.popcon_dir = p |
152 | elif o in ("-s", "--strategy"): | 158 | elif o in ("-s", "--strategy"): |
153 | self.strategy = p | 159 | self.strategy = p |