~ubuntu-branches/ubuntu/raring/software-center/raring-proposed

« back to all changes in this revision

Viewing changes to softwarecenter/backend/recagent.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt, Michael Vogt, Gary Lasker, Nekhelesh Ramananthan, Sebastian Heinlein, Kiwinote
  • Date: 2012-04-10 19:21:21 UTC
  • Revision ID: package-import@ubuntu.com-20120410192121-7eo1shw2hquh8dcu
Tags: 5.1.14.2
[ Michael Vogt ]
* lp:~mvo/software-center/config-tweak:
  - cleanup concerning always having a 'general' section in the cfg file
* lp:~mvo/software-center/pygi-properties-fixes:
  - properly initialize the properties in CellRendererAppView as required
    for pygi, fixes crash on network events (LP: #965937)
* lp:~mvo/software-center/lp977889:
  - fix the disappearing list view sort combobox (LP: #977889)

[ Gary Lasker ]
* lp:~gary-lasker/software-center/recommends-more-button-lp971567:
  - correctly render 'more' button in recommendations panel (LP: #971567)
* lp:~gary-lasker/software-center/show-technical-items-lp955030:
  - make 'show n technical items' appear clickable again (LP: #955030)
* lp:~gary-lasker/software-center/fix-crash-lp969737:
  - fix an intermittent crash that can occur when saving the vertical 
    position of the installed pane treeview on a cache refresh 
    (LP: #969737)
* lp:~gary-lasker/software-center/fix-crash-lp970157:
  - Small fix for a crash that can happen during the installed view 
    treeview initialization (LP: #970157)
* lp:~gary-lasker/software-center/fix-crash-lp968988:
  - Fix crash bug LP: #968988 by making sure that there is always
    a tree_view.selected_row_renderer 
* lp:~gary-lasker/software-center/remember-sort-preference-lp966878:
  - Fix for bug LP: #966878 to not reset the user's sorting preference 
    if they have set one

[ Nekhelesh Ramananthan ]
* lp:~nik90/software-center/add_keywords_new:
  - added keywords to the desktop file for better search criteria
    (LP: #977175)

[ Sebastian Heinlein ]
* lp:~glatzor/software-center/fix-977020:
  - fix software-center error dialogs for errors other than 
    ERROR_INVALID_PACKAGE_FILE and ERROR_UNAUTHENTICATED_PACKAGE 
    (LP: #977020)
  - Allow to repair an incomplete installation (partially fixes 
    LP: #659438)

[ Kiwinote ]
* lp:~kiwinote/software-center/lp951557:
  - don't duplicate text on paste (LP: #951557)

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
    def __init__(self, xid=None):
78
78
        GObject.GObject.__init__(self)
79
79
        self.xid = xid
 
80
        self.config = get_config()
80
81
 
81
82
    def query_server_status(self):
82
83
        # build the command
95
96
 
96
97
    @property
97
98
    def recommender_uuid(self):
98
 
        config = get_config()
99
 
        if config.has_option("general", "recommender_uuid"):
100
 
            recommender_uuid = config.get("general",
101
 
                                          "recommender_uuid")
 
99
        if self.config.has_option("general", "recommender_uuid"):
 
100
            recommender_uuid = self.config.get("general",
 
101
                                               "recommender_uuid")
102
102
        else:
103
103
            recommender_uuid = ""
104
104
        return recommender_uuid
105
105
 
106
106
    @property
107
107
    def recommender_profile_id(self):
108
 
        config = get_config()
109
 
        if config.has_option("general", "recommender_profile_id"):
110
 
            recommender_profile_id = config.get("general",
111
 
                                                "recommender_profile_id")
 
108
        if self.config.has_option("general", "recommender_profile_id"):
 
109
            recommender_profile_id = self.config.get("general",
 
110
                                                     "recommender_profile_id")
112
111
        else:
113
112
            recommender_profile_id = ""
114
113
        return recommender_profile_id
115
114
 
116
115
    def _set_recommender_profile_id(self, profile_id):
117
 
        config = get_config()
118
 
        if not config.has_section("general"):
119
 
            config.add_section("general")
120
 
        config.set("general", "recommender_profile_id", profile_id)
 
116
        self.config.set("general", "recommender_profile_id", profile_id)
121
117
 
122
118
    def _set_recommender_uuid(self, uuid):
123
 
        config = get_config()
124
 
        if not config.has_section("general"):
125
 
            config.add_section("general")
126
 
        config.set("general", "recommender_uuid", uuid)
 
119
        self.config.set("general", "recommender_uuid", uuid)
127
120
 
128
121
    def post_submit_profile(self, db):
129
122
        """ This will post the users profile to the recommender server
235
228
            return False
236
229
 
237
230
    def opt_out(self):
238
 
        config = get_config()
239
 
        config.set("general", "recommender_uuid", "")
240
 
        config.set("general", "recommender_profile_id", "")
 
231
        self.config.set("general", "recommender_uuid", "")
 
232
        self.config.set("general", "recommender_profile_id", "")
241
233
 
242
234
    def _on_server_status_data(self, spawner, piston_server_status):
243
235
        self.emit("server-status", piston_server_status)