Commit 13f6743dc5c5eda0697cb87b68864509a29363d2

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

Added DDE url to config.

Showing 2 changed files with 10 additions and 5 deletions   Show diff stats
@@ -40,7 +40,7 @@ class Config(): @@ -40,7 +40,7 @@ class Config():
40 self.output = "/dev/null" 40 self.output = "/dev/null"
41 self.survey_mode = 1 41 self.survey_mode = 1
42 self.axi = "/var/lib/apt-xapian-index/index" 42 self.axi = "/var/lib/apt-xapian-index/index"
43 - self.dde_url = "http://dde.debian.net/dde/q/udd/packages/all/%s?t=json" 43 + self.dde_url = "http://dde.debian.net/dde/q/udd/packs/all/%s?t=json"
44 self.popcon_index = os.path.expanduser("~/.app-recommender/popcon_index") 44 self.popcon_index = os.path.expanduser("~/.app-recommender/popcon_index")
45 self.popcon_dir = os.path.expanduser("~/.app-recommender/popcon_dir") 45 self.popcon_dir = os.path.expanduser("~/.app-recommender/popcon_dir")
46 self.clusters_dir = os.path.expanduser("~/.app-recommender/clusters_dir") 46 self.clusters_dir = os.path.expanduser("~/.app-recommender/clusters_dir")
@@ -64,11 +64,12 @@ class Config(): @@ -64,11 +64,12 @@ class Config():
64 print "" 64 print ""
65 print " [ data sources ]" 65 print " [ data sources ]"
66 print " -a, --axi=PATH Path to apt-xapian-index" 66 print " -a, --axi=PATH Path to apt-xapian-index"
  67 + print " -e, --dde=URL DDE url"
67 print " -p, --popconindex=PATH Path to popcon index" 68 print " -p, --popconindex=PATH Path to popcon index"
68 print " -m, --popcondir=PATH Path to popcon submissions dir" 69 print " -m, --popcondir=PATH Path to popcon submissions dir"
69 print " -u, --indexmode= 'old'|'reindex'|'cluster'|'recluster'" 70 print " -u, --indexmode= 'old'|'reindex'|'cluster'|'recluster'"
70 print " -l, --clustersdir=PATH Path to popcon clusters dir" 71 print " -l, --clustersdir=PATH Path to popcon clusters dir"
71 - print " -e, --medoids=k Number of medoids for clustering" 72 + print " -c, --medoids=k Number of medoids for clustering"
72 print "" 73 print ""
73 print " [ recommender ]" 74 print " [ recommender ]"
74 print " -w, --weight=OPTION Search weighting scheme" 75 print " -w, --weight=OPTION Search weighting scheme"
@@ -127,9 +128,9 @@ class Config(): @@ -127,9 +128,9 @@ class Config():
127 self.strategy = self.read_option('recommender', 'strategy') 128 self.strategy = self.read_option('recommender', 'strategy')
128 self.profile_size = self.read_option('recommender', 'profile_size') 129 self.profile_size = self.read_option('recommender', 'profile_size')
129 130
130 - short_options = "hdvo:a:p:m:ul:e:w:s:z:" 131 + short_options = "hdvo:a:p:m:ul:c:w:s:z:"
131 long_options = ["help", "debug", "verbose", "output=", 132 long_options = ["help", "debug", "verbose", "output=",
132 - "axi=", "popconindex=", "popcondir=", "indexmode=", 133 + "axi=", "dde=", "popconindex=", "popcondir=", "indexmode=",
133 "clustersdir=", "kmedoids=", "weight=", "strategy=", 134 "clustersdir=", "kmedoids=", "weight=", "strategy=",
134 "profile_size="] 135 "profile_size="]
135 try: 136 try:
@@ -153,6 +154,8 @@ class Config(): @@ -153,6 +154,8 @@ class Config():
153 self.output = p 154 self.output = p
154 elif o in ("-a", "--axi"): 155 elif o in ("-a", "--axi"):
155 self.axi = p + "/index" 156 self.axi = p + "/index"
  157 + elif o in ("-e", "--dde"):
  158 + self.dde_url = p
156 elif o in ("-p", "--popconindex"): 159 elif o in ("-p", "--popconindex"):
157 self.popcon_index = p 160 self.popcon_index = p
158 elif o in ("-m", "--popcondir"): 161 elif o in ("-m", "--popcondir"):
@@ -161,7 +164,7 @@ class Config(): @@ -161,7 +164,7 @@ class Config():
161 self.index_mode = p 164 self.index_mode = p
162 elif o in ("-l", "--clustersdir"): 165 elif o in ("-l", "--clustersdir"):
163 self.clusters_dir = p 166 self.clusters_dir = p
164 - elif o in ("-e", "--kmedoids"): 167 + elif o in ("-c", "--kmedoids"):
165 self.k_medoids = p 168 self.k_medoids = p
166 elif o in ("-w", "--weight"): 169 elif o in ("-w", "--weight"):
167 self.weight = p 170 self.weight = p
src/examples/app_recommender.cfg
@@ -10,6 +10,8 @@ output = /dev/null @@ -10,6 +10,8 @@ output = /dev/null
10 [data_sources] 10 [data_sources]
11 # path to apt-xapian-index 11 # path to apt-xapian-index
12 axi = /var/lib/apt-xapian-index/index 12 axi = /var/lib/apt-xapian-index/index
  13 +# DDE url
  14 +dde_url = http://dde.debian.net/dde/q/udd/packages/all/%s?t=json
13 # old, reindex, cluster, recluster 15 # old, reindex, cluster, recluster
14 index_mode = old 16 index_mode = old
15 # path to popcon index 17 # path to popcon index