コード例 #1
0
ファイル: pamac-install.py プロジェクト: Acidburn0zzz/pamac
def handle_updates(update_data):
	syncfirst, updates = update_data
	if transaction_done:
		exiting('')
	elif updates:
		transaction.ErrorDialog.format_secondary_text(_('Some updates are available.\nPlease update your system first'))
		response = transaction.ErrorDialog.run()
		if response:
			transaction.ErrorDialog.hide()
		exiting('')
	else:
		transaction.action_handler(_('Preparing')+'...')
		transaction.icon_handler('/usr/share/pamac/icons/24x24/status/package-setup.png')
		while Gtk.events_pending():
			Gtk.main_iteration()
		common.write_pid_file()
		transaction.interface.connect_signals(signals)
		transaction.config_dbus_signals()
		pkgs_to_install = argv[1:]
		install(pkgs_to_install)
コード例 #2
0
ファイル: pamac_main.py プロジェクト: prodigeni/Cnchi
def main(_mode):
    if common.pid_file_exists():
        transaction.ErrorDialog.format_secondary_text("Another instance of Pamac is running")
        response = transaction.ErrorDialog.run()
        if response:
            transaction.ErrorDialog.hide()
    else:
        common.write_pid_file()
        global mode
        mode = _mode
        interface.connect_signals(Handler())
        do_refresh()
        if mode == "manager":
            ManagerWindow.show_all()
        if mode == "updater":
            update_label.set_markup("<big><b>Available updates</b></big>")
            UpdaterWindow.show_all()
        while Gtk.events_pending():
            Gtk.main_iteration()
        Gtk.main()
コード例 #3
0
ファイル: pamac-install.py プロジェクト: toudi/pamac
def handle_updates(update_data):
    syncfirst, updates = update_data
    if transaction_done:
        exiting('')
    elif updates:
        transaction.ErrorDialog.format_secondary_text(
            _('Some updates are available.\nPlease update your system first'))
        response = transaction.ErrorDialog.run()
        if response:
            transaction.ErrorDialog.hide()
        exiting('')
    else:
        transaction.action_handler(_('Preparing') + '...')
        transaction.icon_handler(
            '/usr/share/pamac/icons/24x24/status/package-setup.png')
        while Gtk.events_pending():
            Gtk.main_iteration()
        common.write_pid_file()
        transaction.interface.connect_signals(signals)
        transaction.config_dbus_signals()
        pkgs_to_install = argv[1:]
        install(pkgs_to_install)
コード例 #4
0
    transaction.StopDaemon()
    common.rm_pid_file()
    print('check updates failed')
    loop.quit()


def handle_updates(updates):
    common.rm_pid_file()
    transaction.StopDaemon()
    loop.quit()


loop = GObject.MainLoop()

if not common.pid_file_exists():
    common.write_pid_file()
    print('checking updates')
    bus = dbus.SystemBus()
    bus.add_signal_receiver(handle_reply,
                            dbus_interface="org.manjaro.pamac",
                            signal_name="EmitTransactionDone")
    bus.add_signal_receiver(handle_error,
                            dbus_interface="org.manjaro.pamac",
                            signal_name="EmitTransactionError")
    bus.add_signal_receiver(handle_updates,
                            dbus_interface="org.manjaro.pamac",
                            signal_name="EmitAvailableUpdates")
    transaction.get_dbus_methods()
    try:
        transaction.Refresh(False)
    except:
コード例 #5
0
ファイル: pamac-updater.py プロジェクト: Acidburn0zzz/pamac
		'on_UpdaterWindow_delete_event' : on_UpdaterWindow_delete_event,
		'on_UpdaterPreferencesButton_clicked': on_UpdaterPreferencesButton_clicked,
		'on_Updater_ApplyButton_clicked' : on_Updater_ApplyButton_clicked,
		'on_Updater_RefreshButton_clicked' : on_Updater_RefreshButton_clicked,
		'on_Updater_CloseButton_clicked' : on_Updater_CloseButton_clicked}

def config_dbus_signals():
	bus = dbus.SystemBus()
	bus.add_signal_receiver(handle_reply, dbus_interface = "org.manjaro.pamac", signal_name = "EmitTransactionDone")
	bus.add_signal_receiver(handle_error, dbus_interface = "org.manjaro.pamac", signal_name = "EmitTransactionError")
	bus.add_signal_receiver(handle_updates, dbus_interface = "org.manjaro.pamac", signal_name = "EmitAvailableUpdates")
	bus.add_signal_receiver(reload_config, dbus_interface = "org.manjaro.pamac", signal_name = "EmitReloadConfig")

if common.pid_file_exists():
	transaction.ErrorDialog.format_secondary_text(_('Pamac is already running'))
	response = transaction.ErrorDialog.run()
	if response:
		transaction.ErrorDialog.hide()
else:
	common.write_pid_file()
	interface.connect_signals(signals)
	transaction.get_dbus_methods()
	transaction.config_dbus_signals()
	config_dbus_signals()
	UpdaterWindow.show()
	UpdaterWindow.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))
	while Gtk.events_pending():
		Gtk.main_iteration()
	transaction.refresh()
	Gtk.main()