Commit 336d03bf2027bc85e468b97e004911e8e2a10c3c

Authored by Tássia Camões Araújo
2 parents e2abc449 9b74149a
Exists in master and in 1 other branch add_vagrant

Merge branch 'master' of https://github.com/tassia/AppRecommender

src/data.py
... ... @@ -30,6 +30,8 @@ import shutil
30 30 import apt
31 31 import re
32 32 import operator
  33 +import urllib
  34 +import simplejson as json
33 35  
34 36 from error import Error
35 37 from singleton import Singleton
... ... @@ -212,8 +214,8 @@ class DebianPackage():
212 214 self.provides = pkg_version.record['Provides']
213 215  
214 216 def load_details_from_dde(self,dde_server,dde_port):
215   - json_data = json.load(urllib.urlopen("http://%s:%s/q/udd/packages/all/%s?t=json"
216   - % dde_server,dde_port,self.name))
  217 + json_data = json.load(urllib.urlopen("http://%s:%d/q/udd/packages/all/%s?t=json"
  218 + % (dde_server,dde_port,self.name)))
217 219  
218 220 self.maintainer = json_data['r']['maintainer']
219 221 self.version = json_data['r']['version']
... ... @@ -241,7 +243,7 @@ class DebianPackage():
241 243 self.popcon_insts = json_data['r']['popcon']['insts']
242 244  
243 245 def format_description(self,description):
244   - return description.replace('.\n','').replace('\n','<br />')
  246 + return description.replace(' .\n','<br />').replace('\n','<br />')
245 247  
246 248 def debtags_str_to_dict(self, debtags_str):
247 249 debtags_list = [tag.rstrip(",") for tag in debtags_str.split()]
... ...
src/strategy.py
... ... @@ -20,6 +20,7 @@ __license__ = &quot;&quot;&quot;
20 20 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 21 """
22 22  
  23 +import os
23 24 import xapian
24 25 from singleton import Singleton
25 26 import recommender
... ...
src/web/templates/survey.html 100644 → 100755
... ... @@ -36,7 +36,7 @@ button below.
36 36 </div>
37 37  
38 38  
39   -<form action="/save" method="post" enctype="multipart/form-data" name="surveyform">
  39 +<form action="save" method="post" enctype="multipart/form-data" name="surveyform">
40 40  
41 41 <input type="hidden" name="user_id" value=$request.user.user_id>
42 42 <input type="hidden" name="strategy" value=$request.strategy>
... ...