Exemplo n.º 1
0
def handle_error(error):
    ManagerWindow.get_window().set_cursor(None)
    while Gtk.events_pending():
        Gtk.main_iteration()
    if error:
        if not 'DBus.Error.NoReply' in str(error):
            print(error)
            transaction.ErrorDialog.format_secondary_text(str(error))
            response = transaction.ErrorDialog.run()
            if response:
                transaction.ErrorDialog.hide()
                transaction.ProgressWindow.hide()
    transaction.progress_buffer.delete(
        transaction.progress_buffer.get_start_iter(),
        transaction.progress_buffer.get_end_iter())
    transaction.Release()
    transaction.get_handle()
    transaction.mark_needed_pkgs_as_dep()
    transaction.to_add.clear()
    transaction.to_remove.clear()
    transaction.to_update.clear()
    transaction.to_load.clear()
    transaction.to_build.clear()
    ManagerValidButton.set_sensitive(False)
    ManagerCancelButton.set_sensitive(False)
Exemplo n.º 2
0
def handle_reply(reply):
    if transaction.to_build:
        transaction.build_next()
    elif reply:
        transaction.ProgressCloseButton.set_visible(True)
        transaction.action_icon.set_from_icon_name('dialog-information',
                                                   Gtk.IconSize.BUTTON)
        transaction.progress_label.set_text(str(reply))
        transaction.progress_bar.set_text('')
        end_iter = transaction.progress_buffer.get_end_iter()
        transaction.progress_buffer.insert(end_iter, str(reply))
    else:
        transaction.get_updates()
    transaction.Release()
    transaction.get_handle()
    transaction.mark_needed_pkgs_as_dep()
    transaction.to_add.clear()
    transaction.to_remove.clear()
    transaction.to_update.clear()
    transaction.to_load.clear()
    ManagerValidButton.set_sensitive(False)
    ManagerCancelButton.set_sensitive(False)
    global search_dict
    global groups_dict
    global states_dict
    global repos_dict
    search_dict = {}
    groups_dict = {}
    states_dict = {}
    repos_dict = {}
    if current_filter[0]:
        refresh_packages_list(current_filter[0](current_filter[1]))
Exemplo n.º 3
0
def handle_reply(reply):
	if transaction.to_build:
		transaction.build_next() 
	elif reply:
		transaction.ProgressCloseButton.set_visible(True)
		transaction.action_icon.set_from_icon_name('dialog-information', Gtk.IconSize.BUTTON)
		transaction.progress_label.set_text(str(reply))
		transaction.progress_bar.set_text('')
		end_iter = transaction.progress_buffer.get_end_iter()
		transaction.progress_buffer.insert(end_iter, str(reply))
	else:
		transaction.get_updates()
	transaction.Release()
	transaction.get_handle()
	transaction.mark_needed_pkgs_as_dep()
	transaction.to_add.clear()
	transaction.to_remove.clear()
	transaction.to_update.clear()
	transaction.to_load.clear()
	ManagerValidButton.set_sensitive(False)
	ManagerCancelButton.set_sensitive(False)
	global search_dict
	global groups_dict
	global states_dict
	global repos_dict
	search_dict = {}
	groups_dict = {}
	states_dict = {}
	repos_dict = {}
	if current_filter[0]:
		refresh_packages_list(current_filter[0](current_filter[1]))
Exemplo n.º 4
0
def handle_error(error):
	UpdaterWindow.get_window().set_cursor(None)
	while Gtk.events_pending():
		Gtk.main_iteration()
	if error:
		if not 'DBus.Error.NoReply' in str(error):
			print(error)
			transaction.ErrorDialog.format_secondary_text(error)
			response = transaction.ErrorDialog.run()
			if response:
				transaction.ErrorDialog.hide()
				transaction.ProgressWindow.hide()
	transaction.get_handle()
	transaction.mark_needed_pkgs_as_dep()
Exemplo n.º 5
0
def handle_error(error):
    UpdaterWindow.get_window().set_cursor(None)
    while Gtk.events_pending():
        Gtk.main_iteration()
    if error:
        if not 'DBus.Error.NoReply' in str(error):
            print(error)
            transaction.ErrorDialog.format_secondary_text(error)
            response = transaction.ErrorDialog.run()
            if response:
                transaction.ErrorDialog.hide()
                transaction.ProgressWindow.hide()
    transaction.get_handle()
    transaction.mark_needed_pkgs_as_dep()
Exemplo n.º 6
0
def mark_explicitly_installed(widget, pkg):
    error = transaction.SetPkgReason(pkg.name, pyalpm.PKG_REASON_EXPLICIT)
    if error:
        handle_error(error)
    transaction.get_handle()
    global search_dict
    global groups_dict
    global states_dict
    global repos_dict
    search_dict = {}
    groups_dict = {}
    states_dict = {}
    repos_dict = {}
    if current_filter[0]:
        refresh_packages_list(current_filter[0](current_filter[1]))
Exemplo n.º 7
0
def mark_explicitly_installed(widget, pkg):
	error = transaction.SetPkgReason(pkg.name, pyalpm.PKG_REASON_EXPLICIT)
	if error:
		handle_error(error)
	transaction.get_handle()
	global search_dict
	global groups_dict
	global states_dict
	global repos_dict
	search_dict = {}
	groups_dict = {}
	states_dict = {}
	repos_dict = {}
	if current_filter[0]:
		refresh_packages_list(current_filter[0](current_filter[1]))
Exemplo n.º 8
0
def handle_reply(reply):
	while Gtk.events_pending():
		Gtk.main_iteration()
	if transaction.to_build:
		transaction.build_next() 
	elif reply:
		transaction.Release()
		transaction.ProgressCloseButton.set_visible(True)
		transaction.action_icon.set_from_icon_name('dialog-information', Gtk.IconSize.BUTTON)
		transaction.progress_label.set_text(str(reply))
		transaction.progress_bar.set_text('')
		end_iter = transaction.progress_buffer.get_end_iter()
		transaction.progress_buffer.insert(end_iter, str(reply))
		transaction.get_handle()
	else:
		UpdaterWindow.get_window().set_cursor(None)
		transaction.get_handle()
		transaction.get_updates()
	transaction.mark_needed_pkgs_as_dep()
Exemplo n.º 9
0
def handle_reply(reply):
    while Gtk.events_pending():
        Gtk.main_iteration()
    if transaction.to_build:
        transaction.build_next()
    elif reply:
        transaction.Release()
        transaction.ProgressCloseButton.set_visible(True)
        transaction.action_icon.set_from_icon_name('dialog-information',
                                                   Gtk.IconSize.BUTTON)
        transaction.progress_label.set_text(str(reply))
        transaction.progress_bar.set_text('')
        end_iter = transaction.progress_buffer.get_end_iter()
        transaction.progress_buffer.insert(end_iter, str(reply))
        transaction.get_handle()
    else:
        UpdaterWindow.get_window().set_cursor(None)
        transaction.get_handle()
        transaction.get_updates()
    transaction.mark_needed_pkgs_as_dep()
Exemplo n.º 10
0
def handle_error(error):
	ManagerWindow.get_window().set_cursor(None)
	while Gtk.events_pending():
		Gtk.main_iteration()
	if error:
		if not 'DBus.Error.NoReply' in str(error):
			print(error)
			transaction.ErrorDialog.format_secondary_text(str(error))
			response = transaction.ErrorDialog.run()
			if response:
				transaction.ErrorDialog.hide()
				transaction.ProgressWindow.hide()
	transaction.progress_buffer.delete(transaction.progress_buffer.get_start_iter(),transaction.progress_buffer.get_end_iter())
	transaction.Release()
	transaction.get_handle()
	transaction.mark_needed_pkgs_as_dep()
	transaction.to_add.clear()
	transaction.to_remove.clear()
	transaction.to_update.clear()
	transaction.to_load.clear()
	transaction.to_build.clear()
	ManagerValidButton.set_sensitive(False)
	ManagerCancelButton.set_sensitive(False)
Exemplo n.º 11
0
def handle_reply(reply):
    global transaction_type
    global transaction_dict
    if reply:
        transaction.ErrorDialog.format_secondary_text("Error:\n" + str(reply))
        response = transaction.ErrorDialog.run()
        if response:
            transaction.ErrorDialog.hide()
    transaction.t_lock = False
    transaction.Release()
    transaction.ProgressWindow.hide()
    transaction.to_add = []
    transaction.to_remove = []
    transaction_dict.clear()
    transaction.get_handle()
    if (transaction_type == "install") or (transaction_type == "remove"):
        transaction_type = None
        set_packages_list()
    else:
        transaction_type = None
    if have_updates():
        if mode == "manager":
            do_sysupgrade()
Exemplo n.º 12
0
def handle_error(error):
    global transaction_type
    global transaction_dict
    if error:
        if not "DBus.Error.NoReply" in str(error):
            print("error", error)
            transaction.ErrorDialog.format_secondary_text("Error:\n" + str(error))
            response = transaction.ErrorDialog.run()
            if response:
                transaction.ErrorDialog.hide()
    transaction.t_lock = False
    transaction.Release()
    transaction.ProgressWindow.hide()
    if mode == "manager":
        transaction.to_add = []
        transaction.to_remove = []
        transaction_dict.clear()
        transaction_type = None
        transaction.get_handle()
        set_packages_list()
    if mode == "updater":
        have_updates()
    print("error", error)
Exemplo n.º 13
0
                            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()
    state_column.set_cell_data_func(state_rendererpixbuf,
                                    state_column_display_func)
    name_column.set_cell_data_func(name_renderertext, name_column_display_func)
    version_column.set_cell_data_func(version_renderertext,
                                      version_column_display_func)
    repo_column.set_cell_data_func(repo_renderertext, repo_column_display_func)
    size_column.set_cell_data_func(size_renderertext, size_column_display_func)
    transaction.get_handle()
    update_lists()
    ManagerWindow.show()
    #ManagerWindow.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))
    #transaction.refresh()
    while Gtk.events_pending():
        Gtk.main_iteration()
    Gtk.main()
Exemplo n.º 14
0
	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()
	state_column.set_cell_data_func(state_rendererpixbuf, state_column_display_func)
	name_column.set_cell_data_func(name_renderertext, name_column_display_func)
	version_column.set_cell_data_func(version_renderertext, version_column_display_func)
	repo_column.set_cell_data_func(repo_renderertext, repo_column_display_func)
	size_column.set_cell_data_func(size_renderertext, size_column_display_func)
	transaction.get_handle()
	update_lists()
	ManagerWindow.show()
	#ManagerWindow.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))
	#transaction.refresh()
	while Gtk.events_pending():
		Gtk.main_iteration()
	Gtk.main()