Python gi.repository.GLib.set_prgname() Examples
The following are 9
code examples of gi.repository.GLib.set_prgname().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
gi.repository.GLib
, or try the search function
.
Example #1
Source File: main.py From dynamic-wallpaper-editor with GNU General Public License v3.0 | 6 votes |
def __init__(self, version): super().__init__(application_id=APP_ID, flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE) GLib.set_application_name('Dynamic Wallpaper Editor') GLib.set_prgname(APP_ID) self.connect('startup', self.on_startup) self.connect('activate', self.on_activate) self.connect('command-line', self.on_cli) self.register(None) self._version = version self._git_url = 'https://github.com/maoschanz/dynamic-wallpaper-editor' self.add_main_option('version', b'v', GLib.OptionFlags.NONE, GLib.OptionArg.NONE, _("Tell the version of the app"), None) self.add_main_option('new-window', b'n', GLib.OptionFlags.NONE, GLib.OptionArg.NONE, _("Open a new window"), None)
Example #2
Source File: application.py From Authenticator with GNU General Public License v2.0 | 5 votes |
def __init__(self): Gtk.Application.__init__(self, application_id="com.github.bilelmoussaoui.Authenticator", flags=Gio.ApplicationFlags.FLAGS_NONE) GLib.set_application_name(_("Authenticator")) GLib.set_prgname("Authenticator") self.alive = True self._menu = Gio.Menu()
Example #3
Source File: main.py From ImEditor with GNU General Public License v3.0 | 5 votes |
def do_startup(self): Gtk.Application.do_startup(self) GLib.set_application_name('ImEditor') GLib.set_prgname(APP_ID) self.connect('open', self.file_open_handler)
Example #4
Source File: kickoff_player.py From kickoff-player with GNU General Public License v3.0 | 5 votes |
def __init__(self): GLib.set_prgname('kickoff-player') GLib.set_application_name('Kickoff Player') add_custom_css('ui/styles.css') self.argparse = argparse.ArgumentParser(prog='kickoff-player') self.argparse.add_argument('url', metavar='URL', nargs='?', default=None) self.cache = CacheHandler() self.data = DataHandler() self.scores_api = ScoresApi(self.data, self.cache) self.streams_api = StreamsApi(self.data, self.cache) self.main = Gtk.Builder() self.main.add_from_file(relative_path('ui/main.ui')) self.main.connect_signals(self) self.window = self.main.get_object('window_main') self.header_back = self.main.get_object('header_button_back') self.header_reload = self.main.get_object('header_button_reload') self.main_stack = self.main.get_object('stack_main') self.player_stack = self.main.get_object('stack_player') self.matches_stack = self.main.get_object('stack_matches') self.channels_stack = self.main.get_object('stack_channels') self.matches = MatchHandler(self) self.channels = ChannelHandler(self) self.player = PlayerHandler(self) GLib.timeout_add(2000, self.toggle_reload, True) self.open_stream_url()
Example #5
Source File: application.py From Audio-Cutter with GNU General Public License v3.0 | 5 votes |
def __init__(self): Gtk.Application.__init__(self, application_id="com.github.bilelmoussaoui.AudioCutter", flags=Gio.ApplicationFlags.FLAGS_NONE) GLib.set_application_name(_("Audio Cutter")) GLib.set_prgname("Audio Cutter") self.app_menu = Gio.Menu() self._setup_css() Application.instance = self
Example #6
Source File: main.py From ebook-viewer with GNU General Public License v3.0 | 5 votes |
def __init__(self, *args, **kwargs): super().__init__(*args, application_id="easy-ebook-viewer", flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE, **kwargs) self.window = None self.file_path = None GLib.set_application_name('Easy eBook Viewer') GLib.set_prgname('easy-ebook-viewer') GLib.setenv('PULSE_PROP_application.icon_name', 'easy-ebook-viewer', True)
Example #7
Source File: main.py From drawing with GNU General Public License v3.0 | 5 votes |
def __init__(self, version): super().__init__(application_id=APP_ID, flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE) GLib.set_application_name(_("Drawing")) GLib.set_prgname(APP_ID) self._version = version self.has_tools_in_menubar = False self.connect('startup', self.on_startup) self.register(None) self.connect('activate', self.on_activate) self.connect('command-line', self.on_cli) self.add_main_option('version', b'v', GLib.OptionFlags.NONE, GLib.OptionArg.NONE, _("Show the app version"), None) self.add_main_option('new-window', b'n', GLib.OptionFlags.NONE, GLib.OptionArg.NONE, _("Open a new window"), None) self.add_main_option('new-tab', b't', GLib.OptionFlags.NONE, GLib.OptionArg.NONE, _("Open a new tab"), None) self.add_main_option('edit-clipboard', b'c', GLib.OptionFlags.NONE, GLib.OptionArg.NONE, _("Edit the clipboard content"), None) icon_theme = Gtk.IconTheme.get_default() icon_theme.add_resource_path(APP_PATH + '/icons') icon_theme.add_resource_path(APP_PATH + '/tools/icons')
Example #8
Source File: modules.py From gpt with GNU General Public License v3.0 | 4 votes |
def __init__(self): setproctitle.setproctitle("GPT") self.install_dir = os.getcwd() self.user_app_dir = os.path.join(os.path.expanduser("~"), ".config", "gpt", ) # create hidden app folder in user"s home directory if it does # not exist if not os.path.isdir(self.user_app_dir): os.makedirs(self.user_app_dir) # initiate GTK+ application GLib.set_prgname("GPT") # set up logging os.chdir(self.user_app_dir) self.log = logging.getLogger("gpt") with open(os.path.join(self.install_dir, "logging.yaml")) as f: config = yaml.load(f) logging.config.dictConfig(config) self.loglevels = {"critical": 50, "error": 40, "warning": 30, "info": 20, "debug": 10, } # log version info for debugging self.log.debug("Application version: {}".format(__version__)) self.log.debug("GTK+ version: {}.{}.{}".format(Gtk.get_major_version(), Gtk.get_minor_version(), Gtk.get_micro_version(), )) self.log.debug(_("Application executed from {}").format(self.install_dir)) self.locales_dir = os.path.join(self.install_dir, "po", "locale") self.appname = "GPT" # setting up localization locale.bindtextdomain(self.appname, self.locales_dir) locale.textdomain(self.locales_dir) gettext.bindtextdomain(self.appname, self.locales_dir) gettext.textdomain(self.appname) # check for config file to set up working directory # create file in case it does not exist self.config = os.path.join(self.user_app_dir, "config.py") self.defaultwdir = os.path.join(os.path.expanduser("~"), "GP") if os.path.isfile(self.config): self.readconfig() else: self.stdir = self.defaultwdir self.chkdir(self.stdir) self.createconfig(self.stdir) self.kd_supp = True self.show_message(_("Working directory: {}").format(self.stdir))
Example #9
Source File: __main__.py From king-phisher with BSD 3-Clause "New" or "Revised" License | 4 votes |
def main(): parser = argparse.ArgumentParser(prog='KingPhisher', description='King Phisher Client GUI', conflict_handler='resolve') utilities.argp_add_args(parser, default_root='KingPhisher') startup.argp_add_client(parser) arguments = parser.parse_args() # basic runtime checks if sys.version_info < (3, 4): color.print_error('the Python version is too old (minimum required is 3.4)') return 0 if Gtk.check_version(3, 14, 0): color.print_error('the GTK+ version is too old (minimum required is 3.14)') return 0 if sys.platform.startswith('linux') and not os.environ.get('DISPLAY'): color.print_error('no display was detected, this must be run with an interactive X session') return 0 config_file = arguments.config_file use_plugins = arguments.use_plugins use_style = arguments.use_style del arguments, parser logger = logging.getLogger('KingPhisher.Client.CLI') if sys.platform.startswith('linux') and not os.getuid(): logger.warning('it is not necessary to run the king phisher client as root') find.init_data_path('client') if not gui_utilities.which_glade(): color.print_error('unable to locate the glade ui data file') return 0 logger.debug("king phisher version: {0} python version: {1}.{2}.{3}".format(version.version, sys.version_info[0], sys.version_info[1], sys.version_info[2])) logger.debug("client running in process: {0} main tid: 0x{1:x}".format(os.getpid(), threading.current_thread().ident)) GLib.set_application_name('King Phisher') GLib.set_prgname('King Phisher') start_time = time.time() logger.debug('using ui data from glade file: ' + gui_utilities.which_glade()) try: app = application.KingPhisherClientApplication(config_file=config_file, use_plugins=use_plugins, use_style=use_style) except Exception as error: logger.critical("initialization error: {0} ({1})".format(error.__class__.__name__, getattr(error, 'message', 'n/a'))) color.print_error('failed to initialize the King Phisher client') return 0 logger.debug("client loaded in {0:.2f} seconds".format(time.time() - start_time)) GObject.threads_init() return app.run([])