Commit 96e36f1c67cf44bdc8d2c11a8b1a6709b285acc3

Authored by Tássia Camões Araújo
1 parent e6bf05b1
Exists in master and in 1 other branch add_vagrant

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 43 self.axi_values = "/var/lib/apt-xapian-index/values"
44 44 self.popcon_index = "~/.app-recommender/popcon_index"
45 45 self.popcon_dir = "~/.app-recommender/popcon_dir"
  46 + self.clusters_dir = "~/.app-recommender/clusters_dir"
46 47 self.strategy = "ct" # defaults to the cheapest one
47 48 self.reindex = 0
48 49 self.load_options()
... ... @@ -66,6 +67,7 @@ class Config():
66 67 print " -a, --axi=PATH Path to Apt-xapian-index."
67 68 print " -p, --popconindex=PATH Path to popcon dedicated index."
68 69 print " -m, --popcondir=PATH Path to popcon submissions dir."
  70 + print " -l, --clustersdir=PATH Path to popcon clusters dir."
69 71 print " -s, --strategy=OPTION Recommendation strategy."
70 72 print ""
71 73 print " [ strategy options ] "
... ... @@ -110,11 +112,13 @@ class Config():
110 112 self.axi = self.read_option('recommender', 'axi')
111 113 self.popcon_index = self.read_option('recommender', 'popcon_index')
112 114 self.popcon_dir = self.read_option('recommender', 'popcon_dir')
  115 + self.clusters_dir = self.read_option('recommender', 'clusters_dir')
113 116  
114 117 short_options = "hdvo:c:t:i:ra:p:m:s:"
115 118 long_options = ["help", "debug", "verbose", "output=", "config=",
116 119 "tagsdb=", "tagsindex=", "reindex", "axi=",
117   - "popconindex=", "popcondir=", "strategy="]
  120 + "popconindex=", "popcondir=", "clustersdir=",
  121 + "strategy="]
118 122 try:
119 123 opts, args = getopt.getopt(sys.argv[1:], short_options,
120 124 long_options)
... ... @@ -147,7 +151,9 @@ class Config():
147 151 self.axi_values = p + "/values"
148 152 elif o in ("-p", "--popconindex"):
149 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 157 self.popcon_dir = p
152 158 elif o in ("-s", "--strategy"):
153 159 self.strategy = p
... ...