Example #1
0
 def on_purchase_failed(self, widget):
     self._return_to_appdetails_view()
     dialogs.error(
         None,
         _("Failure in the purchase process."),
         _("Sorry, something went wrong. Your payment " "has been cancelled."),
     )
    def _review_write_new(self):
        if (not self.app or
            not self.app.pkgname in self.cache or
            not self.cache[self.app.pkgname].candidate):
            dialogs.error(None, 
                          _("Version unknown"),
                          _("The version of the application can not "
                            "be detected. Entering a review is not "
                            "possible."))
            return
        # gather data
        pkg = self.cache[self.app.pkgname]
        version = pkg.candidate.version
        origin = self.cache.get_origin(self.app.pkgname)

        # FIXME: probably want to not display the ui if we can't review it
        if not origin:
            dialogs.error(None, 
                        _("Origin unknown"),
                        _("The origin of the application can not "
                          "be detected. Entering a review is not "
                          "possible."))
            return

        if pkg.installed:
            version = pkg.installed.version
        # call the loader to do call out the right helper and collect the result
        parent_xid = ''
        #parent_xid = get_parent_xid(self)
        self.review_loader.spawn_write_new_review_ui(
            self.app, version, self.appdetails.icon, origin,
            parent_xid, self.datadir,
            self._reviews_ready_callback)
    def _review_write_new(self):
        if (not self.app or not self.app.pkgname in self.cache
                or not self.cache[self.app.pkgname].candidate):
            dialogs.error(
                None, _("Version unknown"),
                _("The version of the application can not "
                  "be detected. Entering a review is not "
                  "possible."))
            return
        # gather data
        pkg = self.cache[self.app.pkgname]
        version = pkg.candidate.version
        origin = self.cache.get_origin(self.app.pkgname)

        # FIXME: probably want to not display the ui if we can't review it
        if not origin:
            dialogs.error(
                None, _("Origin unknown"),
                _("The origin of the application can not "
                  "be detected. Entering a review is not "
                  "possible."))
            return

        if pkg.installed:
            version = pkg.installed.version
        # call the loader to do call out the right helper and collect the result
        parent_xid = ''
        #parent_xid = get_parent_xid(self)
        self.review_loader.spawn_write_new_review_ui(
            self.app, version, self.appdetails.icon, origin, parent_xid,
            self.datadir, self._reviews_ready_callback)
Example #4
0
        db.open()
    except xapian.DatabaseOpeningError:
        # Couldn't use that folder as a database
        # This may be because we are in a bzr checkout and that
        #   folder is empty. If the folder is empty, and we can find the
        # script that does population, populate a database in it.
        if os.path.isdir(pathname) and not os.listdir(pathname):
            from softwarecenter.db.update import rebuild_database
            logging.info("building local database")
            rebuild_database(pathname)
            db = StoreDatabase(pathname, cache)
            db.open()
    except xapian.DatabaseCorruptError as e:
        logging.exception("xapian open failed")
        dialogs.error(None, _("Sorry, can not open the software database"),
                      _("Please re-install the 'software-center' "
                        "package."))
        # FIXME: force rebuild by providing a dbus service for this
        sys.exit(1)

    purchased_packages = set()
    purchased_packages.add('file-roller')
    purchased_packages.add('alarm-clock')
    purchased_packages.add('pitivi')
    purchased_packages.add('chromium-browser')
    purchased_packages.add('cheese')
    purchased_packages.add('aisleriot')

    account_name = "*****@*****.**"

    deauthorize_computer(None, "./data", db, icons, account_name,
Example #5
0
        db.open()
    except xapian.DatabaseOpeningError:
        # Couldn't use that folder as a database
        # This may be because we are in a bzr checkout and that
        #   folder is empty. If the folder is empty, and we can find the
        # script that does population, populate a database in it.
        if os.path.isdir(pathname) and not os.listdir(pathname):
            from softwarecenter.db.update import rebuild_database
            logging.info("building local database")
            rebuild_database(pathname)
            db = StoreDatabase(pathname, cache)
            db.open()
    except xapian.DatabaseCorruptError as e:
        logging.exception("xapian open failed")
        dialogs.error(None,
                           _("Sorry, can not open the software database"),
                           _("Please re-install the 'software-center' "
                             "package."))
        # FIXME: force rebuild by providing a dbus service for this
        sys.exit(1)

    purchased_packages = set()
    purchased_packages.add('file-roller')
    purchased_packages.add('alarm-clock')
    purchased_packages.add('pitivi')
    purchased_packages.add('chromium-browser')
    purchased_packages.add('cheese')
    purchased_packages.add('aisleriot')

    account_name = "*****@*****.**"

    deauthorize_computer(None,
 def on_purchase_failed(self, widget):
     self._return_to_appdetails_view()
     dialogs.error(
         None, _("Failure in the purchase process."),
         _("Sorry, something went wrong. Your payment "
           "has been cancelled."))