def __init__(self, image_directory, application_path): global_settings.client_name = gui_misc.get_um_name() self.api_lock = nrlock.NRLock() self.image_dir_arg = image_directory if self.image_dir_arg == None: self.image_dir_arg = gui_misc.get_image_path() self.application_path = application_path self.gconf = pmgconf.PMGConf() try: self.application_dir = os.environ["PACKAGE_MANAGER_ROOT"] except KeyError: self.application_dir = "/" misc.setlocale(locale.LC_ALL, "") for module in (gettext, gtk.glade): module.bindtextdomain("pkg", os.path.join( self.application_dir, "usr/share/locale")) module.textdomain("pkg") gui_misc.init_for_help(self.application_dir) self.icon_theme = gtk.icon_theme_get_default() pkg_icon_location = os.path.join(self.application_dir, PKG_ICON_LOCATION) self.icon_theme.append_search_path(pkg_icon_location) icon_location = os.path.join(self.application_dir, ICON_LOCATION) self.icon_theme.append_search_path(icon_location) self.progress_tracker = progress.NullProgressTracker() self.api_obj = None self.installupdate = None self.return_status = enumerations.UPDATES_UNDETERMINED self.pylintstub = None gui_misc.setup_logging() gobject.idle_add(self.__do_image_update)
def __init__(self, image_directory, application_path): global_settings.client_name = gui_misc.get_um_name() self.api_lock = nrlock.NRLock() self.image_dir_arg = image_directory self.exact_match = True if self.image_dir_arg == None: self.image_dir_arg, self.exact_match = api.get_default_image_root() if not self.exact_match: if debug: print >>sys.stderr, ("Unable to get the image directory") sys.exit(enumerations.UPDATES_UNDETERMINED) self.application_path = application_path self.gconf = pmgconf.PMGConf() try: self.application_dir = os.environ["PACKAGE_MANAGER_ROOT"] except KeyError: self.application_dir = "/" misc.setlocale(locale.LC_ALL, "") for module in (gettext, gtk.glade): module.bindtextdomain("pkg", os.path.join(self.application_dir, "usr/share/locale")) module.textdomain("pkg") gui_misc.init_for_help(self.application_dir) self.icon_theme = gtk.icon_theme_get_default() pkg_icon_location = os.path.join(self.application_dir, PKG_ICON_LOCATION) self.icon_theme.append_search_path(pkg_icon_location) icon_location = os.path.join(self.application_dir, ICON_LOCATION) self.icon_theme.append_search_path(icon_location) self.progress_tracker = progress.NullProgressTracker() self.api_obj = None self.installupdate = None self.return_status = enumerations.UPDATES_UNDETERMINED self.pylintstub = None gui_misc.setup_logging() gobject.idle_add(self.__do_image_update)
def __init__(self, image_dir): global_settings.client_name = gui_misc.get_wi_name() self.image_dir = image_dir try: self.application_dir = os.environ["PACKAGE_MANAGER_ROOT"] except KeyError: self.application_dir = "/" misc.setlocale(locale.LC_ALL, "") for module in (gettext, gtk.glade): module.bindtextdomain("pkg", os.path.join( self.application_dir, "usr/share/locale")) module.textdomain("pkg") gui_misc.init_for_help(self.application_dir) self.pub_pkg_list = None self.pr = progress.NullProgressTracker() self.pub_new_tasks = [] self.pkg_install_tasks = [] self.icon_theme = gtk.icon_theme_get_default() icon_location = os.path.join(self.application_dir, ICON_LOCATION) self.icon_theme.append_search_path(icon_location) self.param = None self.disabled_pubs = {} self.repo_gui = None self.first_run = True # Webinstall Dialog builder = gtk.Builder() self.gladefile = os.path.join(self.application_dir, "usr/share/package-manager/packagemanager.ui") builder.add_from_file(self.gladefile) self.w_webinstall_dialog = \ builder.get_object("webinstalldialog") self.w_webinstall_proceed = \ builder.get_object("proceed_button") self.w_webinstall_cancel = \ builder.get_object("cancel_button") self.w_webinstall_help = \ builder.get_object("help_button") self.w_webinstall_close = \ builder.get_object("close_button") self.w_webinstall_proceed_label = \ builder.get_object("proceed_new_repo_label") self.w_webinstall_toplabel = \ builder.get_object("webinstall_toplabel") self.w_webinstall_frame = \ builder.get_object("webinstall_frame") self.w_webinstall_image = \ builder.get_object("pkgimage") self.window_icon = gui_misc.get_icon(self.icon_theme, 'packagemanager', 48) self.w_webinstall_image.set_from_pixbuf(self.window_icon) self.w_webinstall_info_label = \ builder.get_object("label19") self.w_webinstall_textview = \ builder.get_object("webinstall_textview") infobuffer = self.w_webinstall_textview.get_buffer() infobuffer.create_tag("bold", weight=pango.WEIGHT_BOLD) infobuffer.create_tag("disabled", foreground="#757575") #Close to DimGrey self.__setup_signals() self.w_webinstall_dialog.set_icon(self.window_icon) self.api_o = gui_misc.get_api_object(self.image_dir, self.pr, self.w_webinstall_dialog) gui_misc.setup_logging()
def __init__(self, image_dir): global_settings.client_name = gui_misc.get_wi_name() self.image_dir = image_dir try: self.application_dir = os.environ["PACKAGE_MANAGER_ROOT"] except KeyError: self.application_dir = "/" misc.setlocale(locale.LC_ALL, "") for module in (gettext, gtk.glade): module.bindtextdomain( "pkg", os.path.join(self.application_dir, "usr/share/locale")) module.textdomain("pkg") gui_misc.init_for_help(self.application_dir) self.pub_pkg_list = None self.pr = progress.NullProgressTracker() self.pub_new_tasks = [] self.pkg_install_tasks = [] self.icon_theme = gtk.icon_theme_get_default() icon_location = os.path.join(self.application_dir, ICON_LOCATION) self.icon_theme.append_search_path(icon_location) self.param = None self.disabled_pubs = {} self.repo_gui = None self.first_run = True # Webinstall Dialog builder = gtk.Builder() self.gladefile = os.path.join( self.application_dir, "usr/share/package-manager/packagemanager.ui") builder.add_from_file(self.gladefile) self.w_webinstall_dialog = \ builder.get_object("webinstalldialog") self.w_webinstall_proceed = \ builder.get_object("proceed_button") self.w_webinstall_cancel = \ builder.get_object("cancel_button") self.w_webinstall_help = \ builder.get_object("help_button") self.w_webinstall_close = \ builder.get_object("close_button") self.w_webinstall_proceed_label = \ builder.get_object("proceed_new_repo_label") self.w_webinstall_toplabel = \ builder.get_object("webinstall_toplabel") self.w_webinstall_frame = \ builder.get_object("webinstall_frame") self.w_webinstall_image = \ builder.get_object("pkgimage") self.window_icon = gui_misc.get_icon(self.icon_theme, 'packagemanager', 48) self.w_webinstall_image.set_from_pixbuf(self.window_icon) self.w_webinstall_info_label = \ builder.get_object("label19") self.w_webinstall_textview = \ builder.get_object("webinstall_textview") infobuffer = self.w_webinstall_textview.get_buffer() infobuffer.create_tag("bold", weight=pango.WEIGHT_BOLD) infobuffer.create_tag("disabled", foreground="#757575") #Close to DimGrey self.__setup_signals() self.w_webinstall_dialog.set_icon(self.window_icon) self.api_o = gui_misc.get_api_object(self.image_dir, self.pr, self.w_webinstall_dialog) gui_misc.setup_logging()