Exemplo n.º 1
0
log = logging.getLogger("SourceCenter")

APP_PARSER = AppParser()
CONFIG = Config()
PPA_MIRROR = []
UNCONVERT = False
PPA_URL = 'ppa.launchpad.net'
WARNING_KEY = '/apps/ubuntu-tweak/disable_thidparty_warning'
UBUNTU_CN_STR = 'archive.ubuntu.org.cn/ubuntu-cn'
UBUNTU_CN_URL = 'http://archive.ubuntu.org.cn/ubuntu-cn/'
#UBUNTU_CN_URL = 'http://127.0.0.1:8000'
UPDATE_SETTING = GconfSetting(key='/apps/ubuntu-tweak/sourcecenter_update', type=bool)
VERSION_SETTING = GconfSetting(key='/apps/ubuntu-tweak/sourcecenter_version', type=str)

SOURCE_ROOT = os.path.join(consts.CONFIG_ROOT, 'sourcecenter')
SOURCE_VERSION_URL = utdata.get_version_url('/sourcecenter_version/')
UPGRADE_DICT = {}

def get_source_data_url():
    return utdata.get_download_url('/static/utdata/sourcecenter-%s.tar.gz' %
                                   VERSION_SETTING.get_value())

def get_source_logo_from_filename(file_name):
    path = os.path.join(SOURCE_ROOT, file_name)
    if not os.path.exists(path) or file_name == '':
        path = os.path.join(consts.DATA_DIR, 'pixmaps/ppa-logo.png')

    try:
        pixbuf = gtk.gdk.pixbuf_new_from_file(path)
        if pixbuf.get_width() != 32 or pixbuf.get_height() != 32:
            pixbuf = pixbuf.scale_simple(32, 32, gtk.gdk.INTERP_BILINEAR)
Exemplo n.º 2
0
from ubuntutweak.modules import TweakModule
from ubuntutweak.gui.dialogs import ErrorDialog, InfoDialog, QuestionDialog
from ubuntutweak.gui.dialogs import ProcessDialog
from ubuntutweak.gui.gtk import post_ui, set_busy, unset_busy
from ubuntutweak.utils.parser import Parser
from ubuntutweak.network import utdata
from ubuntutweak.network.downloadmanager import DownloadDialog
from ubuntutweak.settings.gsettings import GSetting
from ubuntutweak.utils import set_label_for_stock_button, icon
from ubuntutweak.utils.package import AptWorker
from ubuntutweak.apps import CategoryView

log = logging.getLogger("AppCenter")

APPCENTER_ROOT = os.path.join(consts.CONFIG_ROOT, 'appcenter')
APP_VERSION_URL = utdata.get_version_url('/appcenter_version/')
UPDATE_SETTING = GSetting(key='com.ubuntu-tweak.tweak.appcenter-has-update',
                          type=bool)
VERSION_SETTING = GSetting(key='com.ubuntu-tweak.tweak.appcenter-version',
                           type=str)


def get_app_data_url():
    return utdata.get_download_url('/media/utdata/appcenter-%s.tar.gz' %
                                   VERSION_SETTING.get_value())


if not os.path.exists(APPCENTER_ROOT):
    os.mkdir(APPCENTER_ROOT)

Exemplo n.º 3
0
from ubuntutweak.modules  import TweakModule
from ubuntutweak.widgets.dialogs import ErrorDialog, InfoDialog, QuestionDialog
from ubuntutweak.widgets.dialogs import ProcessDialog
from ubuntutweak.utils.parser import Parser
from ubuntutweak.network import utdata
from ubuntutweak.network.downloadmanager import DownloadDialog
from ubuntutweak.conf import GconfSetting
from ubuntutweak.common import consts
from ubuntutweak.common.config import TweakSettings
from ubuntutweak.common.utils import set_label_for_stock_button
from ubuntutweak.common.package import PACKAGE_WORKER, PackageInfo

log = logging.getLogger("AppCenter")

APPCENTER_ROOT = os.path.join(consts.CONFIG_ROOT, 'appcenter')
APP_VERSION_URL = utdata.get_version_url('/appcenter_version/')
UPDATE_SETTING = GconfSetting(key='/apps/ubuntu-tweak/appcenter_update', type=bool)
VERSION_SETTING = GconfSetting(key='/apps/ubuntu-tweak/appcenter_version', type=str)

def get_app_data_url():
    return utdata.get_download_url('/static/utdata/appcenter-%s.tar.gz' %
                                   VERSION_SETTING.get_value())

if not os.path.exists(APPCENTER_ROOT):
    os.mkdir(APPCENTER_ROOT)

class StatusProvider(object):
    def __init__(self, name):
        self.__path = os.path.join(consts.CONFIG_ROOT, name)
        self.__init = False
Exemplo n.º 4
0
from ubuntutweak.admins.appcenter import CheckUpdateDialog, FetchingDialog, PackageInfo

log = logging.getLogger("SourceCenter")

APP_PARSER = AppParser()
PPA_MIRROR = []
UNCONVERT = False
WARNING_KEY = 'com.ubuntu-tweak.apps.disable-warning'
CONFIG = GSetting(key=WARNING_KEY)
UPDATE_SETTING = GSetting(key='com.ubuntu-tweak.apps.sources-can-update',
                          type=bool)
VERSION_SETTING = GSetting(key='com.ubuntu-tweak.apps.sources-version',
                           type=str)

SOURCE_ROOT = os.path.join(consts.CONFIG_ROOT, 'sourcecenter')
SOURCE_VERSION_URL = utdata.get_version_url('/sourcecenter_version/')
UPGRADE_DICT = {}


def get_source_data_url():
    return utdata.get_download_url('/media/utdata/sourcecenter-%s.tar.gz' %
                                   VERSION_SETTING.get_value())


def get_source_logo_from_filename(file_name):
    path = os.path.join(SOURCE_ROOT, file_name)
    if not os.path.exists(path) or file_name == '':
        path = os.path.join(consts.DATA_DIR, 'pixmaps/ppa-logo.png')

    try:
        pixbuf = GdkPixbuf.Pixbuf.new_from_file(path)