From ef8c973335b1d69d09c015d5b390a09cf0d7a803 Mon Sep 17 00:00:00 2001 From: Tássia Camões Araújo Date: Tue, 20 Sep 2011 17:46:37 +0000 Subject: [PATCH] Survey running under apache. --- src/config.py | 6 +++--- src/web/app_recommender.cfg | 38 -------------------------------------- src/web/static/css/apprec.css | 0 src/web/static/css/debtags.css | 0 src/web/static/css/dropdown.css | 0 src/web/static/css/facebox.css | 0 src/web/static/css/local.css | 0 src/web/static/css/quimby.css | 0 src/web/static/css/screen.css | 0 src/web/static/css/style.css | 2 ++ src/web/static/css/survey.css | 22 ++++++---------------- src/web/static/css/tabs.css | 0 src/web/static/css/voting.css | 0 src/web/static/favicon.ico | Bin 4710 -> 0 bytes src/web/static/images/AppRecommender-logo.jpg | Bin 32883 -> 0 bytes src/web/static/images/admon-important.png | Bin 1516 -> 0 bytes src/web/static/images/admon-note.png | Bin 1255 -> 0 bytes src/web/static/images/admon-tip.png | Bin 1910 -> 0 bytes src/web/static/images/admon-warning.png | Bin 1871 -> 0 bytes src/web/static/images/closelabel.png | Bin 168 -> 0 bytes src/web/static/images/delete.gif | Bin 752 -> 0 bytes src/web/static/images/diaappr.png | Bin 45322 -> 0 bytes src/web/static/images/emblem-downloads.png | Bin 638 -> 0 bytes src/web/static/images/gradient.png | Bin 247 -> 0 bytes src/web/static/images/greydot.png | Bin 197 -> 0 bytes src/web/static/images/icon45.png | Bin 2512 -> 0 bytes src/web/static/images/icon55.png | Bin 3253 -> 0 bytes src/web/static/images/icon95.png | Bin 7297 -> 0 bytes src/web/static/images/loadingAnimation.gif | Bin 5886 -> 0 bytes src/web/static/images/logo-gray-gradient.png | Bin 287 -> 0 bytes src/web/static/images/logo.png | Bin 25175 -> 0 bytes src/web/static/images/macFFBgHack.png | Bin 207 -> 0 bytes src/web/static/images/master-vfl172243.png | Bin 16008 -> 0 bytes src/web/static/images/no-dis.JPG | Bin 825 -> 0 bytes src/web/static/images/no-enb.JPG | Bin 901 -> 0 bytes src/web/static/images/openlogo-50.png | Bin 2006 -> 0 bytes src/web/static/images/pattern.gif | Bin 276 -> 0 bytes src/web/static/images/pixel-vfl73.gif | Bin 43 -> 0 bytes src/web/static/images/reddot.png | Bin 146 -> 0 bytes src/web/static/images/smile-g.png | Bin 2646 -> 0 bytes src/web/static/images/smile-p.png | Bin 2788 -> 0 bytes src/web/static/images/smile-s.png | Bin 2569 -> 0 bytes src/web/static/images/spinner.gif | Bin 1553 -> 0 bytes src/web/static/images/star.gif | Bin 815 -> 0 bytes src/web/static/images/tick.gif | Bin 1068 -> 0 bytes src/web/static/images/upload.png | Bin 891 -> 0 bytes src/web/static/images/yes-dis.JPG | Bin 827 -> 0 bytes src/web/static/images/yes-enb.JPG | Bin 866 -> 0 bytes src/web/static/js/FormManager.js | 0 src/web/static/js/facebox.js | 0 src/web/static/js/form.js | 0 src/web/static/js/handlers.js | 0 src/web/static/js/jquery.MetaData.js | 0 src/web/static/js/jquery.autocomplete.js | 0 src/web/static/js/jquery.flyout.js | 0 src/web/static/js/jquery.jgrowl.js | 0 src/web/static/js/jquery.js | 0 src/web/static/js/jquery.livequery.js | 0 src/web/static/js/jquery.rating.js | 0 src/web/static/js/jquery.simplerss.js | 0 src/web/static/js/jquery.tooltip.js | 0 src/web/static/json/screenshots.json | 0 src/web/survey.py | 65 ++++++++++++++++++++++++++++++++++++++++------------------------- src/web/templates/README | 0 src/web/templates/about.html | 8 ++++---- src/web/templates/apprec.html | 6 +++--- src/web/templates/custom.html | 0 src/web/templates/error.html | 0 src/web/templates/error_survey.html | 0 src/web/templates/index.html | 15 ++++++--------- src/web/templates/layout.html | 12 ++++++------ src/web/templates/package.html | 4 ++-- src/web/templates/searchbox.html | 0 src/web/templates/support.html | 0 src/web/templates/survey.html | 52 ++++++++++++++++++++-------------------------------- src/web/templates/survey_index.html | 25 ++++--------------------- src/web/templates/tabs.html | 0 src/web/templates/thanks.html | 2 +- src/web/templates/thanks_id.html | 0 79 files changed, 97 insertions(+), 160 deletions(-) delete mode 100644 src/web/app_recommender.cfg mode change 100644 => 100755 src/web/static/css/apprec.css mode change 100644 => 100755 src/web/static/css/debtags.css mode change 100644 => 100755 src/web/static/css/dropdown.css mode change 100644 => 100755 src/web/static/css/facebox.css mode change 100644 => 100755 src/web/static/css/local.css mode change 100644 => 100755 src/web/static/css/quimby.css mode change 100644 => 100755 src/web/static/css/screen.css mode change 100644 => 100755 src/web/static/css/style.css mode change 100644 => 100755 src/web/static/css/survey.css mode change 100644 => 100755 src/web/static/css/tabs.css mode change 100644 => 100755 src/web/static/css/voting.css mode change 100644 => 100755 src/web/static/favicon.ico mode change 100644 => 100755 src/web/static/images/AppRecommender-logo.jpg mode change 100644 => 100755 src/web/static/images/admon-important.png mode change 100644 => 100755 src/web/static/images/admon-note.png mode change 100644 => 100755 src/web/static/images/admon-tip.png mode change 100644 => 100755 src/web/static/images/admon-warning.png mode change 100644 => 100755 src/web/static/images/closelabel.png mode change 100644 => 100755 src/web/static/images/delete.gif mode change 100644 => 100755 src/web/static/images/diaappr.png mode change 100644 => 100755 src/web/static/images/emblem-downloads.png mode change 100644 => 100755 src/web/static/images/gradient.png mode change 100644 => 100755 src/web/static/images/greydot.png mode change 100644 => 100755 src/web/static/images/icon45.png mode change 100644 => 100755 src/web/static/images/icon55.png mode change 100644 => 100755 src/web/static/images/icon95.png mode change 100644 => 100755 src/web/static/images/loadingAnimation.gif mode change 100644 => 100755 src/web/static/images/logo-gray-gradient.png mode change 100644 => 100755 src/web/static/images/logo.png mode change 100644 => 100755 src/web/static/images/macFFBgHack.png mode change 100644 => 100755 src/web/static/images/master-vfl172243.png mode change 100644 => 100755 src/web/static/images/no-dis.JPG mode change 100644 => 100755 src/web/static/images/no-enb.JPG mode change 100644 => 100755 src/web/static/images/openlogo-50.png mode change 100644 => 100755 src/web/static/images/pattern.gif mode change 100644 => 100755 src/web/static/images/pixel-vfl73.gif mode change 100644 => 100755 src/web/static/images/reddot.png mode change 100644 => 100755 src/web/static/images/smile-g.png mode change 100644 => 100755 src/web/static/images/smile-p.png mode change 100644 => 100755 src/web/static/images/smile-s.png mode change 100644 => 100755 src/web/static/images/spinner.gif mode change 100644 => 100755 src/web/static/images/star.gif mode change 100644 => 100755 src/web/static/images/tick.gif mode change 100644 => 100755 src/web/static/images/upload.png mode change 100644 => 100755 src/web/static/images/yes-dis.JPG mode change 100644 => 100755 src/web/static/images/yes-enb.JPG mode change 100644 => 100755 src/web/static/js/FormManager.js mode change 100644 => 100755 src/web/static/js/facebox.js mode change 100644 => 100755 src/web/static/js/form.js mode change 100644 => 100755 src/web/static/js/handlers.js mode change 100644 => 100755 src/web/static/js/jquery.MetaData.js mode change 100644 => 100755 src/web/static/js/jquery.autocomplete.js mode change 100644 => 100755 src/web/static/js/jquery.flyout.js mode change 100644 => 100755 src/web/static/js/jquery.jgrowl.js mode change 100644 => 100755 src/web/static/js/jquery.js mode change 100644 => 100755 src/web/static/js/jquery.livequery.js mode change 100644 => 100755 src/web/static/js/jquery.rating.js mode change 100644 => 100755 src/web/static/js/jquery.simplerss.js mode change 100644 => 100755 src/web/static/js/jquery.tooltip.js mode change 100644 => 100755 src/web/static/json/screenshots.json mode change 100644 => 100755 src/web/templates/README mode change 100644 => 100755 src/web/templates/about.html mode change 100644 => 100755 src/web/templates/apprec.html mode change 100644 => 100755 src/web/templates/custom.html mode change 100644 => 100755 src/web/templates/error.html mode change 100644 => 100755 src/web/templates/error_survey.html mode change 100644 => 100755 src/web/templates/index.html mode change 100644 => 100755 src/web/templates/layout.html mode change 100644 => 100755 src/web/templates/package.html mode change 100644 => 100755 src/web/templates/searchbox.html mode change 100644 => 100755 src/web/templates/support.html mode change 100644 => 100755 src/web/templates/survey_index.html mode change 100644 => 100755 src/web/templates/tabs.html mode change 100644 => 100755 src/web/templates/thanks.html mode change 100644 => 100755 src/web/templates/thanks_id.html diff --git a/src/config.py b/src/config.py index 110cae1..4b4014d 100644 --- a/src/config.py +++ b/src/config.py @@ -43,7 +43,7 @@ class Config(Singleton): self.output = "log" ## data_source options - self.base_dir = os.path.expanduser("~/.app-recommender/") + self.base_dir = os.path.expanduser("/home/tiago/.app-recommender/") # filters for valid packages self.filters_dir = os.path.join(self.base_dir,"filters") self.pkgs_filter = os.path.join(self.filters_dir,"desktopapps") @@ -64,9 +64,9 @@ class Config(Singleton): self.clusters_dir = os.path.join(self.base_dir,"clusters-dir") self.k_medoids = 100 # self.dde_url = "http://dde.debian.net/dde/q/udd/packs/all/%s?t=json" - self.dde_url = "http://46.4.235.200:8000/q/udd/packages/all/%s?t=json" + self.dde_url = "http://46.4.235.200:8000/q/udd/packages/prio-debian-sid/%s?t=json" self.dde_server = "46.4.235.200" - self.dde_port = "8000" + self.dde_port = 8000 ## recomender options self.strategy = "cb" diff --git a/src/web/app_recommender.cfg b/src/web/app_recommender.cfg deleted file mode 100644 index c41149f..0000000 --- a/src/web/app_recommender.cfg +++ /dev/null @@ -1,38 +0,0 @@ -# Config file for AppRecommender - -[general] -# logging level -debug = 1 -verbose = 0 -# output file -output = log/apprec-survey - -[data_sources] -# path to recommender filters -filters = ~/.app-recommender/filters -# path to apt-xapian-index -axi = /root/.app-recommender/axi_program -# DDE url -dde_url = http://46.4.235.200:8000/q/udd/packages/all/%s?t=json -# old, reindex, cluster, recluster -index_mode = old -# path to popcon index -popcon_index = ~/.app-recommender/popcon-index_program -# path to popcon submissions dir -popcon_dir = ~/.app-recommender/popcon-entries/ -# path to valid_pkgs file -pkgs_filter = program -# path to popcon clusters dir -clusters_dir = ~/.app-recommender/clusters_dir_full -# number of medoids for clustering -k_medoids = 100 -# number of popcon submission for indexing -max_popcon = 1000 - -[recommender] -# recommendation strategy -strategy = cb -# search weighting scheme ('trad' or 'bm25') -weight = bm25 -# user profile size -profile_size = 50 diff --git a/src/web/static/css/apprec.css b/src/web/static/css/apprec.css old mode 100644 new mode 100755 index e9269af..e9269af --- a/src/web/static/css/apprec.css +++ b/src/web/static/css/apprec.css diff --git a/src/web/static/css/debtags.css b/src/web/static/css/debtags.css old mode 100644 new mode 100755 index 1eeadfd..1eeadfd --- a/src/web/static/css/debtags.css +++ b/src/web/static/css/debtags.css diff --git a/src/web/static/css/dropdown.css b/src/web/static/css/dropdown.css old mode 100644 new mode 100755 index 1e5ccb4..1e5ccb4 --- a/src/web/static/css/dropdown.css +++ b/src/web/static/css/dropdown.css diff --git a/src/web/static/css/facebox.css b/src/web/static/css/facebox.css old mode 100644 new mode 100755 index 3309bb9..3309bb9 --- a/src/web/static/css/facebox.css +++ b/src/web/static/css/facebox.css diff --git a/src/web/static/css/local.css b/src/web/static/css/local.css old mode 100644 new mode 100755 index 09d728f..09d728f --- a/src/web/static/css/local.css +++ b/src/web/static/css/local.css diff --git a/src/web/static/css/quimby.css b/src/web/static/css/quimby.css old mode 100644 new mode 100755 index 39a91fd..39a91fd --- a/src/web/static/css/quimby.css +++ b/src/web/static/css/quimby.css diff --git a/src/web/static/css/screen.css b/src/web/static/css/screen.css old mode 100644 new mode 100755 index 8005612..8005612 --- a/src/web/static/css/screen.css +++ b/src/web/static/css/screen.css diff --git a/src/web/static/css/style.css b/src/web/static/css/style.css old mode 100644 new mode 100755 index a04b3e6..4588272 --- a/src/web/static/css/style.css +++ b/src/web/static/css/style.css @@ -226,9 +226,11 @@ color: #444; h5 { font-style: italic; font-size: 0.75em; +color: #444; } pre { margin: 1.5em 0 1.5em 0; +font-size: 1.3em; overflow: auto; font-family: monospace; white-space: pre; diff --git a/src/web/static/css/survey.css b/src/web/static/css/survey.css old mode 100644 new mode 100755 index 9664c18..9709f1d --- a/src/web/static/css/survey.css +++ b/src/web/static/css/survey.css @@ -97,7 +97,6 @@ margin-bottom: 10px; } .radioButton, -.radioButton:hover, #next-button, #restart-button, #continue-button, @@ -118,14 +117,6 @@ z-index: 2; cursor: pointer; } -.radioButton:hover { -height: 20px; -box-shadow: 0 0 4px gray; -border: 1px solid #eeeeec; -background: #eeeeec; -color: #000; -} - #continue-button { float: right; } @@ -144,7 +135,6 @@ vertical-align: middle; width: 150px; height: 20px; margin-bottom: 10px; -float: left; font-size: 12px; font-weight: 600; line-height: 14px; @@ -155,10 +145,10 @@ z-index: 2; cursor: pointer; } -#optionalform, #panel-controls { position: relative; -width: 170px; +width: 200px; +height: 60px; padding: 5px; margin: 5px; border-radius: 5px; @@ -180,10 +170,10 @@ font-weight: bold; #next-button { text-align: center; position: absolute; -top: 85px; -right: 70px; -width: 80px; -height: 20px; +top: 50px; +right: 68px; +width: 60px; +height: 16px; float: right; z-index: 3; } diff --git a/src/web/static/css/tabs.css b/src/web/static/css/tabs.css old mode 100644 new mode 100755 index fbd88fb..fbd88fb --- a/src/web/static/css/tabs.css +++ b/src/web/static/css/tabs.css diff --git a/src/web/static/css/voting.css b/src/web/static/css/voting.css old mode 100644 new mode 100755 index d20f222..d20f222 --- a/src/web/static/css/voting.css +++ b/src/web/static/css/voting.css diff --git a/src/web/static/favicon.ico b/src/web/static/favicon.ico old mode 100644 new mode 100755 index 8f4e75c..8f4e75c Binary files a/src/web/static/favicon.ico and b/src/web/static/favicon.ico differ diff --git a/src/web/static/images/AppRecommender-logo.jpg b/src/web/static/images/AppRecommender-logo.jpg old mode 100644 new mode 100755 index ce38e2e..ce38e2e Binary files a/src/web/static/images/AppRecommender-logo.jpg and b/src/web/static/images/AppRecommender-logo.jpg differ diff --git a/src/web/static/images/admon-important.png b/src/web/static/images/admon-important.png old mode 100644 new mode 100755 index 151d38c..151d38c Binary files a/src/web/static/images/admon-important.png and b/src/web/static/images/admon-important.png differ diff --git a/src/web/static/images/admon-note.png b/src/web/static/images/admon-note.png old mode 100644 new mode 100755 index d01b8c6..d01b8c6 Binary files a/src/web/static/images/admon-note.png and b/src/web/static/images/admon-note.png differ diff --git a/src/web/static/images/admon-tip.png b/src/web/static/images/admon-tip.png old mode 100644 new mode 100755 index 2ac5747..2ac5747 Binary files a/src/web/static/images/admon-tip.png and b/src/web/static/images/admon-tip.png differ diff --git a/src/web/static/images/admon-warning.png b/src/web/static/images/admon-warning.png old mode 100644 new mode 100755 index dbf3d19..dbf3d19 Binary files a/src/web/static/images/admon-warning.png and b/src/web/static/images/admon-warning.png differ diff --git a/src/web/static/images/closelabel.png b/src/web/static/images/closelabel.png old mode 100644 new mode 100755 index c339e59..c339e59 Binary files a/src/web/static/images/closelabel.png and b/src/web/static/images/closelabel.png differ diff --git a/src/web/static/images/delete.gif b/src/web/static/images/delete.gif old mode 100644 new mode 100755 index 43c6ca8..43c6ca8 Binary files a/src/web/static/images/delete.gif and b/src/web/static/images/delete.gif differ diff --git a/src/web/static/images/diaappr.png b/src/web/static/images/diaappr.png old mode 100644 new mode 100755 index eaa1388..eaa1388 Binary files a/src/web/static/images/diaappr.png and b/src/web/static/images/diaappr.png differ diff --git a/src/web/static/images/emblem-downloads.png b/src/web/static/images/emblem-downloads.png old mode 100644 new mode 100755 index f0356e2..f0356e2 Binary files a/src/web/static/images/emblem-downloads.png and b/src/web/static/images/emblem-downloads.png differ diff --git a/src/web/static/images/gradient.png b/src/web/static/images/gradient.png old mode 100644 new mode 100755 index dc4a8b8..dc4a8b8 Binary files a/src/web/static/images/gradient.png and b/src/web/static/images/gradient.png differ diff --git a/src/web/static/images/greydot.png b/src/web/static/images/greydot.png old mode 100644 new mode 100755 index ec23c01..ec23c01 Binary files a/src/web/static/images/greydot.png and b/src/web/static/images/greydot.png differ diff --git a/src/web/static/images/icon45.png b/src/web/static/images/icon45.png old mode 100644 new mode 100755 index 2580e13..2580e13 Binary files a/src/web/static/images/icon45.png and b/src/web/static/images/icon45.png differ diff --git a/src/web/static/images/icon55.png b/src/web/static/images/icon55.png old mode 100644 new mode 100755 index 7ecb0f7..7ecb0f7 Binary files a/src/web/static/images/icon55.png and b/src/web/static/images/icon55.png differ diff --git a/src/web/static/images/icon95.png b/src/web/static/images/icon95.png old mode 100644 new mode 100755 index 3a9630a..3a9630a Binary files a/src/web/static/images/icon95.png and b/src/web/static/images/icon95.png differ diff --git a/src/web/static/images/loadingAnimation.gif b/src/web/static/images/loadingAnimation.gif old mode 100644 new mode 100755 index 82290f4..82290f4 Binary files a/src/web/static/images/loadingAnimation.gif and b/src/web/static/images/loadingAnimation.gif differ diff --git a/src/web/static/images/logo-gray-gradient.png b/src/web/static/images/logo-gray-gradient.png old mode 100644 new mode 100755 index 014d3dd..014d3dd Binary files a/src/web/static/images/logo-gray-gradient.png and b/src/web/static/images/logo-gray-gradient.png differ diff --git a/src/web/static/images/logo.png b/src/web/static/images/logo.png old mode 100644 new mode 100755 index 27c86fe..27c86fe Binary files a/src/web/static/images/logo.png and b/src/web/static/images/logo.png differ diff --git a/src/web/static/images/macFFBgHack.png b/src/web/static/images/macFFBgHack.png old mode 100644 new mode 100755 index c6473b3..c6473b3 Binary files a/src/web/static/images/macFFBgHack.png and b/src/web/static/images/macFFBgHack.png differ diff --git a/src/web/static/images/master-vfl172243.png b/src/web/static/images/master-vfl172243.png old mode 100644 new mode 100755 index 02650e1..02650e1 Binary files a/src/web/static/images/master-vfl172243.png and b/src/web/static/images/master-vfl172243.png differ diff --git a/src/web/static/images/no-dis.JPG b/src/web/static/images/no-dis.JPG old mode 100644 new mode 100755 index b28ddff..b28ddff Binary files a/src/web/static/images/no-dis.JPG and b/src/web/static/images/no-dis.JPG differ diff --git a/src/web/static/images/no-enb.JPG b/src/web/static/images/no-enb.JPG old mode 100644 new mode 100755 index 555e894..555e894 Binary files a/src/web/static/images/no-enb.JPG and b/src/web/static/images/no-enb.JPG differ diff --git a/src/web/static/images/openlogo-50.png b/src/web/static/images/openlogo-50.png old mode 100644 new mode 100755 index 20d490f..20d490f Binary files a/src/web/static/images/openlogo-50.png and b/src/web/static/images/openlogo-50.png differ diff --git a/src/web/static/images/pattern.gif b/src/web/static/images/pattern.gif old mode 100644 new mode 100755 index 1346c71..1346c71 Binary files a/src/web/static/images/pattern.gif and b/src/web/static/images/pattern.gif differ diff --git a/src/web/static/images/pixel-vfl73.gif b/src/web/static/images/pixel-vfl73.gif old mode 100644 new mode 100755 index 5bfd67a..5bfd67a Binary files a/src/web/static/images/pixel-vfl73.gif and b/src/web/static/images/pixel-vfl73.gif differ diff --git a/src/web/static/images/reddot.png b/src/web/static/images/reddot.png old mode 100644 new mode 100755 index 76cc993..76cc993 Binary files a/src/web/static/images/reddot.png and b/src/web/static/images/reddot.png differ diff --git a/src/web/static/images/smile-g.png b/src/web/static/images/smile-g.png old mode 100644 new mode 100755 index 50883ad..50883ad Binary files a/src/web/static/images/smile-g.png and b/src/web/static/images/smile-g.png differ diff --git a/src/web/static/images/smile-p.png b/src/web/static/images/smile-p.png old mode 100644 new mode 100755 index 47151a5..47151a5 Binary files a/src/web/static/images/smile-p.png and b/src/web/static/images/smile-p.png differ diff --git a/src/web/static/images/smile-s.png b/src/web/static/images/smile-s.png old mode 100644 new mode 100755 index 3b70af1..3b70af1 Binary files a/src/web/static/images/smile-s.png and b/src/web/static/images/smile-s.png differ diff --git a/src/web/static/images/spinner.gif b/src/web/static/images/spinner.gif old mode 100644 new mode 100755 index 085ccae..085ccae Binary files a/src/web/static/images/spinner.gif and b/src/web/static/images/spinner.gif differ diff --git a/src/web/static/images/star.gif b/src/web/static/images/star.gif old mode 100644 new mode 100755 index d0948a7..d0948a7 Binary files a/src/web/static/images/star.gif and b/src/web/static/images/star.gif differ diff --git a/src/web/static/images/tick.gif b/src/web/static/images/tick.gif old mode 100644 new mode 100755 index a53ab25..a53ab25 Binary files a/src/web/static/images/tick.gif and b/src/web/static/images/tick.gif differ diff --git a/src/web/static/images/upload.png b/src/web/static/images/upload.png old mode 100644 new mode 100755 index e8e1af9..e8e1af9 Binary files a/src/web/static/images/upload.png and b/src/web/static/images/upload.png differ diff --git a/src/web/static/images/yes-dis.JPG b/src/web/static/images/yes-dis.JPG old mode 100644 new mode 100755 index f69ab53..f69ab53 Binary files a/src/web/static/images/yes-dis.JPG and b/src/web/static/images/yes-dis.JPG differ diff --git a/src/web/static/images/yes-enb.JPG b/src/web/static/images/yes-enb.JPG old mode 100644 new mode 100755 index a6e36ac..a6e36ac Binary files a/src/web/static/images/yes-enb.JPG and b/src/web/static/images/yes-enb.JPG differ diff --git a/src/web/static/js/FormManager.js b/src/web/static/js/FormManager.js old mode 100644 new mode 100755 index ae70b58..ae70b58 --- a/src/web/static/js/FormManager.js +++ b/src/web/static/js/FormManager.js diff --git a/src/web/static/js/facebox.js b/src/web/static/js/facebox.js old mode 100644 new mode 100755 index 88aea09..88aea09 --- a/src/web/static/js/facebox.js +++ b/src/web/static/js/facebox.js diff --git a/src/web/static/js/form.js b/src/web/static/js/form.js old mode 100644 new mode 100755 index 35ef964..35ef964 --- a/src/web/static/js/form.js +++ b/src/web/static/js/form.js diff --git a/src/web/static/js/handlers.js b/src/web/static/js/handlers.js old mode 100644 new mode 100755 index bdf423b..bdf423b --- a/src/web/static/js/handlers.js +++ b/src/web/static/js/handlers.js diff --git a/src/web/static/js/jquery.MetaData.js b/src/web/static/js/jquery.MetaData.js old mode 100644 new mode 100755 index 5000828..5000828 --- a/src/web/static/js/jquery.MetaData.js +++ b/src/web/static/js/jquery.MetaData.js diff --git a/src/web/static/js/jquery.autocomplete.js b/src/web/static/js/jquery.autocomplete.js old mode 100644 new mode 100755 index c9ddfb2..c9ddfb2 --- a/src/web/static/js/jquery.autocomplete.js +++ b/src/web/static/js/jquery.autocomplete.js diff --git a/src/web/static/js/jquery.flyout.js b/src/web/static/js/jquery.flyout.js old mode 100644 new mode 100755 index 44247a3..44247a3 --- a/src/web/static/js/jquery.flyout.js +++ b/src/web/static/js/jquery.flyout.js diff --git a/src/web/static/js/jquery.jgrowl.js b/src/web/static/js/jquery.jgrowl.js old mode 100644 new mode 100755 index a045005..a045005 --- a/src/web/static/js/jquery.jgrowl.js +++ b/src/web/static/js/jquery.jgrowl.js diff --git a/src/web/static/js/jquery.js b/src/web/static/js/jquery.js old mode 100644 new mode 100755 index 48590ec..48590ec --- a/src/web/static/js/jquery.js +++ b/src/web/static/js/jquery.js diff --git a/src/web/static/js/jquery.livequery.js b/src/web/static/js/jquery.livequery.js old mode 100644 new mode 100755 index 1ddde9b..1ddde9b --- a/src/web/static/js/jquery.livequery.js +++ b/src/web/static/js/jquery.livequery.js diff --git a/src/web/static/js/jquery.rating.js b/src/web/static/js/jquery.rating.js old mode 100644 new mode 100755 index 2c24a62..2c24a62 --- a/src/web/static/js/jquery.rating.js +++ b/src/web/static/js/jquery.rating.js diff --git a/src/web/static/js/jquery.simplerss.js b/src/web/static/js/jquery.simplerss.js old mode 100644 new mode 100755 index 4ae7920..4ae7920 --- a/src/web/static/js/jquery.simplerss.js +++ b/src/web/static/js/jquery.simplerss.js diff --git a/src/web/static/js/jquery.tooltip.js b/src/web/static/js/jquery.tooltip.js old mode 100644 new mode 100755 index a8d0cc6..a8d0cc6 --- a/src/web/static/js/jquery.tooltip.js +++ b/src/web/static/js/jquery.tooltip.js diff --git a/src/web/static/json/screenshots.json b/src/web/static/json/screenshots.json old mode 100644 new mode 100755 index 6dede78..6dede78 --- a/src/web/static/json/screenshots.json +++ b/src/web/static/json/screenshots.json diff --git a/src/web/survey.py b/src/web/survey.py index 9f59db1..ade8130 100755 --- a/src/web/survey.py +++ b/src/web/survey.py @@ -10,7 +10,7 @@ import apt import re import socket -sys.path.insert(0,"../") +sys.path.insert(0,"/var/www/AppRecommender/src/") import logging from config import Config @@ -20,6 +20,9 @@ from data import DebianPackage import urllib +# avoid "RuntimeError: maximum recursion depth exceeded" +sys.setrecursionlimit(50000) + class Index: def GET(self): return render.survey_index() @@ -32,12 +35,17 @@ class Thanks: def POST(self): web_input = web.input() user_id = web_input['user_id'].encode('utf8') - with open("./submissions/%s/ident" % user_id,'w') as ident: + with open("/var/www/AppRecommender/src/web/submissions/%s/ident" % user_id,'w') as ident: for key in ["name","email","comments"]: if web_input.has_key(key): ident.write("%s: %s\n" % (key,web_input[key].encode("utf-8"))) return render.thanks_id() +class Fake: + def GET(self): + return render.index() + #return render_plain.fake() + class Package: def GET(self, pkg): result = self.get_details_from_dde(pkg) @@ -49,8 +57,6 @@ class Package: # parse tags tags = self._debtags_list_to_dict(json_data['r']['tag']) json_data['r']['tag'] = tags - # format long description - json_data['r']['long_description'] = json_data['r']['long_description'].replace(' .\n','').replace('\n','
') return json_data['r'] def _debtags_list_to_dict(self, debtags_list): @@ -85,7 +91,7 @@ class Save: logging.info("Saving user evaluation...") logging.info(web_input) user_id = web_input['user_id'].encode('utf8') - with open("./submissions/%s/uploaded_file" % user_id) as packages_list: + with open("/var/www/AppRecommender/src/web/submissions/%s/uploaded_file" % user_id) as packages_list: pkgs_list = [line.strip() for line in packages_list.readlines()] strategy = web_input['strategy'] logging.debug("Saving evaluation for user %s, strategy %s and packages..." @@ -98,7 +104,7 @@ class Save: for key, value in web_input.items(): if key.startswith("evaluation-"): evaluations[value.encode('utf8')].append(key.lstrip("evaluation-")) - output_dir = ("./submissions/%s/%s/" % (user_id,strategy)) + output_dir = ("/var/www/AppRecommender/src/web/submissions/%s/%s/" % (user_id,strategy)) for key,value in evaluations.items(): with open(os.path.join(output_dir,key),'w') as output: for item in value: @@ -157,14 +163,14 @@ class Survey: logging.info("Setting up survey...") self.cfg = Config() self.rec = Recommender(self.cfg) - self.submissions_dir = "./submissions/" + self.submissions_dir = "/var/www/AppRecommender/src/web/submissions/" if not os.path.exists(self.submissions_dir): os.makedirs(self.submissions_dir) def POST(self): web_input = web.input(pkgs_file={}) logging.debug("Survey web_input %s" % str(web_input)) - self.strategies = ["demo_cb","demo_cbd","demo_cbt","demo_col"]#,"demo_colco"] + self.strategies = ["knn","knn_eset","cbd_eset","knnco"]#,"demo_colco"] request = Request(web_input,self.submissions_dir) if not request.validates(): return render.error_survey() @@ -184,7 +190,7 @@ class Survey: logging.info("Selected \'%s\' from %s" % (request.strategy,strategies)) # Get recommendation self.rec.set_strategy(request.strategy) - prediction = self.rec.get_recommendation(request.user,2).get_prediction() + prediction = self.rec.get_recommendation(request.user,10).get_prediction() logging.info("Prediction for user %s" % request.user_id) logging.info(str(prediction)) strategy_dir = os.path.join(request.user_dir,request.strategy) @@ -228,23 +234,32 @@ def add_global_hook(): return handler() return _wrapper -render = web.template.render('templates/', base='layout', globals={'hasattr':hasattr}) -render_plain = web.template.render('templates/') - -urls = ('/', 'Index', - '/survey', 'Survey', - '/apprec', 'Survey', - '/thanks', 'Thanks', - '/save', 'Save', - '/thanks', 'Thanks', - '/about', 'About', - '/package/(.*)', 'Package' +render = web.template.render('/var/www/AppRecommender/src/web/templates/', base='layout', globals={'hasattr':hasattr}) +render_plain = web.template.render('/var/www/AppRecommender/src/web/templates/') + +urls = ('/survey', 'Index', + '/survey/', 'Index', + '/survey/survey', 'Survey', + '/survey/apprec', 'Survey', + '/survey/thanks', 'Thanks', + '/survey/save', 'Save', + '/survey/thanks', 'Thanks', + '/survey/about', 'About', + '/survey/package/(.*)', 'Package', + '/', 'Index', + '/index', 'Index' + #'/', 'Fake', + #'/index', 'Fake' ) web.webapi.internalerror = web.debugerror -if __name__ == "__main__": - cfg = Config() - apprec = web.application(urls, globals()) - apprec.add_processor(add_global_hook()) - apprec.run() +#if __name__ == "__main__": +cfg = Config() +# apprec = web.application(urls, globals()) +# application = web.application(urls, globals()).wsgifunc() +app = web.application(urls, globals(), autoreload=False) +application = app.wsgifunc() + +# apprec.add_processor(add_global_hook()) +# apprec.run() diff --git a/src/web/templates/README b/src/web/templates/README old mode 100644 new mode 100755 index 7e46bac..7e46bac --- a/src/web/templates/README +++ b/src/web/templates/README diff --git a/src/web/templates/about.html b/src/web/templates/about.html old mode 100644 new mode 100755 index 59b8882..b84cfcd --- a/src/web/templates/about.html +++ b/src/web/templates/about.html @@ -6,8 +6,8 @@ $var jsfiles: static/js/facebox.js @@ -30,9 +30,9 @@ initially developed using the Debian Project infrasctructure, but the solution is essentially distro-independent and can even be adapted to non GNU/Linux systems given that there is available data for that.

- + AppRecommender dataflow +src="static/images/diaappr.png" width="230px" />

The picture on the right gives an idea of the data workflow diff --git a/src/web/templates/apprec.html b/src/web/templates/apprec.html old mode 100644 new mode 100755 index a54419d..44a3dcd --- a/src/web/templates/apprec.html +++ b/src/web/templates/apprec.html @@ -7,8 +7,8 @@ $var jsfiles: static/js/facebox.js - + + $if content.has_key('jsfiles'): $for js in content.jsfiles.split(): @@ -63,7 +63,7 @@ function validateForm()