Ejemplo n.º 1
0
 def _on_whoami_data(self, spawner, piston_whoami):
     # once we have data, make sure to save it
     config = get_config()
     config.email = piston_whoami["preferred_email"]
     config.reviews_username = piston_whoami["username"]
     # emit
     self.emit("whoami", piston_whoami)
Ejemplo n.º 2
0
 def _on_whoami_data(self, spawner, piston_whoami):
     # once we have data, make sure to save it
     config = get_config()
     config.email = piston_whoami["preferred_email"]
     config.reviews_username = piston_whoami["username"]
     # emit
     self.emit("whoami", piston_whoami)
Ejemplo n.º 3
0
 def _get_recommender_uuid(self):
     """ returns the recommender UUID value, which can be empty if it
         has not yet been set (indicating that the user has not yet
         opted-in to the recommender service)
     """
     config = get_config()
     if config.has_option("general", "recommender_uuid"):
         recommender_uuid = config.get("general", "recommender_uuid")
         if recommender_uuid:
             return recommender_uuid
     return ""
Ejemplo n.º 4
0
    def on_transaction_started(self, backend, pkgname, appname, trans_id,
                               trans_type):
        details = self.TransactionDetails(self.db, pkgname, appname, trans_id, trans_type)
        self.transactions_queue[pkgname] = details

        config = get_config()
        if (trans_type == TransactionTypes.INSTALL and
            trans_id != PURCHASE_TRANSACTION_ID and
                config.add_to_unity_launcher and
                softwarecenter.utils.is_unity_running()):
            if details.desktop_file is not None:
                self._add_application_to_unity_launcher(details)
    def setUpClass(cls):
        # we can only have one instance of availablepane, so create it here
        cls.win = get_test_window_availablepane()
        cls.available_pane = cls.win.get_data("pane")

        # get the global config
        cls.config = get_config()

        # patch is_unity_running so that the test works inside a e.g.
        # ADT
        patch("softwarecenter.utils.is_unity_running").start().return_value = True
        patch("softwarecenter.backend.unitylauncher.UnityLauncher"
              "._get_launcher_dbus_iface").start().return_value = Mock()
Ejemplo n.º 6
0
    def setUpClass(cls):
        # we can only have one instance of availablepane, so create it here
        cls.win = get_test_window_availablepane()
        cls.available_pane = cls.win.get_data("pane")

        # get the global config
        cls.config = get_config()

        # patch is_unity_running so that the test works inside a e.g.
        # ADT
        patch("softwarecenter.utils.is_unity_running").start(
        ).return_value = True
        patch("softwarecenter.backend.unitylauncher.UnityLauncher"
              "._get_launcher_dbus_iface").start().return_value = Mock()
Ejemplo n.º 7
0
 def test_config_singleton(self):
     config1 = get_config()
     config2 = get_config()
     self.assertEqual(config1, config2)
Ejemplo n.º 8
0
 def _on_whoami_data(self, spawner, piston_whoami):
     # once we have data, make sure to save it
     config = get_config()
     config.set("general", "email", piston_whoami["preferred_email"])
     # emit
     self.emit("whoami", piston_whoami)
 def __init__(self):
     GObject.GObject.__init__(self)
     self.wk = None
     self._wk_handlers_blocked = False
     self._oauth_token = None
     self.config = get_config()
Ejemplo n.º 10
0
 def __init__(self):
     GObject.GObject.__init__(self)
     self.wk = None
     self._wk_handlers_blocked = False
     self._oauth_token = None
     self.config = get_config()
Ejemplo n.º 11
0
 def __init__(self):
     super(PurchaseView, self).__init__()
     self.wk = None
     self._wk_handlers_blocked = False
     self._oauth_token = None
     self.config = get_config()
Ejemplo n.º 12
0
 def test_config_singleton(self):
     config1 = get_config()
     config2 = get_config()
     self.assertEqual(config1, config2)
Ejemplo n.º 13
0
 def __init__(self, xid=None):
     GObject.GObject.__init__(self)
     self.xid = xid
     self.config = get_config()
Ejemplo n.º 14
0
 def __init__(self):
     super(PurchaseView, self).__init__()
     self.wk = None
     self._wk_handlers_blocked = False
     self._oauth_token = None
     self.config = get_config()