mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
pylint: Check for unused variables, fix fallout
This commit is contained in:
parent
2dd81900fa
commit
0fd57daca1
@ -165,7 +165,7 @@ def setup_logging(debug_stdout):
|
||||
logging.info("Application startup")
|
||||
|
||||
# Register libvirt handler
|
||||
def libvirt_callback(ctx, err):
|
||||
def libvirt_callback(ctx_ignore, err):
|
||||
if err[3] != libvirt.VIR_ERR_ERROR:
|
||||
# Don't log libvirt errors: global error handler will do that
|
||||
logging.warn("Non-error from libvirt: '%s'" % err[2])
|
||||
|
@ -23,15 +23,15 @@ import gtk
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
|
||||
def on_email(about, mail):
|
||||
ignore = about
|
||||
if hasattr(gtk, "show_uri"):
|
||||
gtk.show_uri(None, "mailto:%s" % mail, gtk.get_current_event_time())
|
||||
|
||||
gtk.about_dialog_set_email_hook(on_email)
|
||||
|
||||
def on_url(about, link):
|
||||
ignore = about
|
||||
if hasattr(gtk, "show_uri"):
|
||||
gtk.show_uri(None, link, gtk.get_current_event_time())
|
||||
|
||||
gtk.about_dialog_set_url_hook(on_url)
|
||||
|
||||
class vmmAbout(vmmGObjectUI):
|
||||
|
@ -694,7 +694,7 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
|
||||
self.window.get_widget("create-forward").show()
|
||||
|
||||
def page_changed(self, notebook, page, page_number):
|
||||
def page_changed(self, notebook_ignore, page_ignore, page_number):
|
||||
devbox = self.window.get_widget("host-device")
|
||||
devbox.hide()
|
||||
|
||||
@ -1344,7 +1344,7 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
|
||||
self.storage_browser.show(conn)
|
||||
|
||||
def show_help(self, src):
|
||||
def show_help(self, src_ignore):
|
||||
# help to show depends on the notebook page, yahoo
|
||||
page = self.window.get_widget("create-pages").get_current_page()
|
||||
if page == PAGE_INTRO:
|
||||
|
@ -139,7 +139,7 @@ class vmmChooseCD(vmmGObjectUI):
|
||||
_("Floppy D_rive"))
|
||||
self.window.get_widget("iso-image").set_label(_("Floppy _Image"))
|
||||
|
||||
def set_storage_path(self, src, path):
|
||||
def set_storage_path(self, src_ignore, path):
|
||||
self.window.get_widget("iso-path").set_text(path)
|
||||
|
||||
def _browse_file(self):
|
||||
|
@ -398,6 +398,7 @@ class vmmCloneVM(vmmGObjectUI):
|
||||
disk_name_box.pack_start(disk_name_label, True)
|
||||
|
||||
def sep_func(model, it, combo):
|
||||
ignore = combo
|
||||
return model[it][2]
|
||||
|
||||
# [String, sensitive, is sep]
|
||||
@ -491,7 +492,7 @@ class vmmCloneVM(vmmGObjectUI):
|
||||
ok_button.set_sensitive(clone)
|
||||
util.tooltip_wrapper(ok_button, tooltip)
|
||||
|
||||
def net_show_popup(self, widget, event):
|
||||
def net_show_popup(self, widget_ignore, event):
|
||||
if event.button != 3:
|
||||
return
|
||||
|
||||
@ -509,7 +510,7 @@ class vmmCloneVM(vmmGObjectUI):
|
||||
|
||||
self.change_mac.show_all()
|
||||
|
||||
def storage_show_popup(self, widget, event):
|
||||
def storage_show_popup(self, widget_ignore, event):
|
||||
if event.button != 3:
|
||||
return
|
||||
|
||||
@ -691,9 +692,7 @@ class vmmCloneVM(vmmGObjectUI):
|
||||
self.clone_design = cd
|
||||
return True
|
||||
|
||||
def finish(self, src):
|
||||
|
||||
# validate input
|
||||
def finish(self, src_ignore):
|
||||
try:
|
||||
if not self.validate():
|
||||
return
|
||||
@ -760,7 +759,7 @@ class vmmCloneVM(vmmGObjectUI):
|
||||
def change_storage_browse(self, ignore):
|
||||
|
||||
cs = self.change_storage_window
|
||||
def callback(self, txt):
|
||||
def callback(src_ignore, txt):
|
||||
cs.get_widget("change-storage-new").set_text(txt)
|
||||
|
||||
if self.storage_browser == None:
|
||||
@ -808,6 +807,7 @@ def can_we_clone(conn, vol, path):
|
||||
|
||||
def do_we_default(conn, vol, path, ro, shared, devtype):
|
||||
""" Returns (do we clone by default?, info string if not)"""
|
||||
ignore = conn
|
||||
info = ""
|
||||
|
||||
def append_str(str1, str2, delim=", "):
|
||||
|
@ -152,6 +152,7 @@ class vmmConnect(vmmGObjectUI):
|
||||
self.window.get_widget("hypervisor").set_active(1)
|
||||
|
||||
def add_service(self, interface, protocol, name, type, domain, flags):
|
||||
ignore = flags
|
||||
try:
|
||||
# Async service resolving
|
||||
res = self.server.ServiceResolverNew(interface, protocol, name,
|
||||
@ -167,6 +168,12 @@ class vmmConnect(vmmGObjectUI):
|
||||
logging.exception(e)
|
||||
|
||||
def remove_service(self, interface, protocol, name, type, domain, flags):
|
||||
ignore = domain
|
||||
ignore = protocol
|
||||
ignore = flags
|
||||
ignore = interface
|
||||
ignore = type
|
||||
|
||||
try:
|
||||
model = self.window.get_widget("hostname").get_model()
|
||||
name = str(name)
|
||||
@ -178,6 +185,15 @@ class vmmConnect(vmmGObjectUI):
|
||||
|
||||
def add_conn_to_list(self, interface, protocol, name, type, domain,
|
||||
host, aprotocol, address, port, text, flags):
|
||||
ignore = domain
|
||||
ignore = protocol
|
||||
ignore = flags
|
||||
ignore = interface
|
||||
ignore = type
|
||||
ignore = text
|
||||
ignore = aprotocol
|
||||
ignore = port
|
||||
|
||||
try:
|
||||
model = self.window.get_widget("hostname").get_model()
|
||||
for row in model:
|
||||
@ -236,16 +252,16 @@ class vmmConnect(vmmGObjectUI):
|
||||
|
||||
self.window.get_widget("hostname").child.set_text(entry)
|
||||
|
||||
def hostname_changed(self, src):
|
||||
def hostname_changed(self, src_ignore):
|
||||
self.populate_uri()
|
||||
|
||||
def hypervisor_changed(self, src):
|
||||
def hypervisor_changed(self, src_ignore):
|
||||
self.populate_uri()
|
||||
|
||||
def username_changed(self, src):
|
||||
def username_changed(self, src_ignore):
|
||||
self.populate_uri()
|
||||
|
||||
def connect_remote_toggled(self, src):
|
||||
def connect_remote_toggled(self, src_ignore):
|
||||
is_remote = self.is_remote()
|
||||
self.window.get_widget("hostname").set_sensitive(is_remote)
|
||||
self.window.get_widget("connection").set_sensitive(is_remote)
|
||||
@ -259,7 +275,7 @@ class vmmConnect(vmmGObjectUI):
|
||||
self.populate_default_user()
|
||||
self.populate_uri()
|
||||
|
||||
def connection_changed(self, src):
|
||||
def connection_changed(self, src_ignore):
|
||||
self.populate_default_user()
|
||||
self.populate_uri()
|
||||
|
||||
|
@ -358,6 +358,7 @@ class vmmConnection(gobject.GObject):
|
||||
return hostname
|
||||
|
||||
def get_hostname(self, resolveLocal=False):
|
||||
ignore = resolveLocal
|
||||
try:
|
||||
return self.get_qualified_hostname()
|
||||
except:
|
||||
@ -485,6 +486,7 @@ class vmmConnection(gobject.GObject):
|
||||
return self._nodedev_capable
|
||||
|
||||
def _get_flags_helper(self, obj, key, check_func):
|
||||
ignore = obj
|
||||
flags_dict = self._xml_flags.get(key)
|
||||
|
||||
if flags_dict == None:
|
||||
@ -956,6 +958,7 @@ class vmmConnection(gobject.GObject):
|
||||
return -1
|
||||
|
||||
def _do_creds(self, creds, cbdata):
|
||||
ignore = cbdata
|
||||
try:
|
||||
if (len(creds) == 1 and
|
||||
creds[0][0] == libvirt.VIR_CRED_EXTERNAL and
|
||||
|
@ -184,7 +184,7 @@ class vmmConsolePages(vmmGObjectUI):
|
||||
self.topwin.set_title(_("Press %s to release pointer.") % keystr +
|
||||
" " + self.title)
|
||||
|
||||
def pointer_ungrabbed(self, src):
|
||||
def pointer_ungrabbed(self, src_ignore):
|
||||
self.topwin.set_title(self.title)
|
||||
|
||||
def _disable_modifiers(self):
|
||||
@ -287,7 +287,7 @@ class vmmConsolePages(vmmGObjectUI):
|
||||
|
||||
self.update_scaling()
|
||||
|
||||
def size_to_vm(self, src):
|
||||
def size_to_vm(self, src_ignore):
|
||||
# Resize the console to best fit the VM resolution
|
||||
if not self.desktop_resolution:
|
||||
return
|
||||
@ -346,7 +346,7 @@ class vmmConsolePages(vmmGObjectUI):
|
||||
if status == libvirt.VIR_DOMAIN_CRASHED:
|
||||
self.activate_unavailable_page(_("Guest has crashed"))
|
||||
|
||||
def update_widget_states(self, vm, status):
|
||||
def update_widget_states(self, vm, status_ignore):
|
||||
runable = vm.is_runable()
|
||||
pages = self.window.get_widget("console-pages")
|
||||
page = pages.get_current_page()
|
||||
@ -424,7 +424,7 @@ class vmmConsolePages(vmmGObjectUI):
|
||||
# VNC Specific methods #
|
||||
########################
|
||||
|
||||
def _vnc_disconnected(self, src):
|
||||
def _vnc_disconnected(self, src_ignore):
|
||||
errout = ""
|
||||
if self.vncTunnel is not None:
|
||||
errout = self.get_tunnel_err_output()
|
||||
@ -450,7 +450,7 @@ class vmmConsolePages(vmmGObjectUI):
|
||||
|
||||
self.activate_unavailable_page(error)
|
||||
|
||||
def _vnc_initialized(self, src):
|
||||
def _vnc_initialized(self, src_ignore):
|
||||
self.vnc_connected = True
|
||||
logging.debug("VNC initialized")
|
||||
self.activate_viewer_page()
|
||||
@ -580,7 +580,7 @@ class vmmConsolePages(vmmGObjectUI):
|
||||
libvirt.VIR_DOMAIN_CRASHED ] or
|
||||
self.vm.get_id() < 0)
|
||||
|
||||
def try_login(self, src=None):
|
||||
def try_login(self, src_ignore=None):
|
||||
if self.skip_connect_attempt():
|
||||
# Don't try and login for these cases
|
||||
return
|
||||
@ -646,7 +646,7 @@ class vmmConsolePages(vmmGObjectUI):
|
||||
traceback.format_exc (stacktrace))
|
||||
logging.error(details)
|
||||
|
||||
def set_credentials(self, src=None):
|
||||
def set_credentials(self, src_ignore=None):
|
||||
passwd = self.window.get_widget("console-auth-password")
|
||||
if passwd.flags() & gtk.VISIBLE:
|
||||
self.vncViewer.set_credential(gtkvnc.CREDENTIAL_PASSWORD,
|
||||
@ -660,7 +660,7 @@ class vmmConsolePages(vmmGObjectUI):
|
||||
self.config.set_console_password(self.vm, passwd.get_text(),
|
||||
username.get_text())
|
||||
|
||||
def _vnc_auth_credential(self, src, credList):
|
||||
def _vnc_auth_credential(self, src_ignore, credList):
|
||||
for i in range(len(credList)):
|
||||
if credList[i] not in [gtkvnc.CREDENTIAL_PASSWORD,
|
||||
gtkvnc.CREDENTIAL_USERNAME,
|
||||
@ -688,7 +688,7 @@ class vmmConsolePages(vmmGObjectUI):
|
||||
if withUsername or withPassword:
|
||||
self.activate_auth_page(withPassword, withUsername)
|
||||
|
||||
def desktop_resize(self, src, w, h):
|
||||
def desktop_resize(self, src_ignore, w, h):
|
||||
self.desktop_resolution = (w, h)
|
||||
self.window.get_widget("console-vnc-scroll").queue_resize()
|
||||
|
||||
@ -738,7 +738,7 @@ class vmmConsolePages(vmmGObjectUI):
|
||||
|
||||
widget.queue_resize()
|
||||
|
||||
def scroll_size_allocate(self, src, req):
|
||||
def scroll_size_allocate(self, src_ignore, req):
|
||||
if not self.desktop_resolution:
|
||||
return
|
||||
|
||||
|
@ -1086,7 +1086,7 @@ class vmmCreate(vmmGObjectUI):
|
||||
|
||||
instnotebook.set_current_page(instpage)
|
||||
|
||||
def back(self, src):
|
||||
def back(self, src_ignore):
|
||||
notebook = self.window.get_widget("create-pages")
|
||||
curpage = notebook.get_current_page()
|
||||
is_import = (self.get_config_install_page() == INSTALL_PAGE_IMPORT)
|
||||
@ -1100,7 +1100,7 @@ class vmmCreate(vmmGObjectUI):
|
||||
|
||||
notebook.set_current_page(next_page)
|
||||
|
||||
def forward(self, ignore=None):
|
||||
def forward(self, src_ignore=None):
|
||||
notebook = self.window.get_widget("create-pages")
|
||||
curpage = notebook.get_current_page()
|
||||
is_import = (self.get_config_install_page() == INSTALL_PAGE_IMPORT)
|
||||
@ -1171,7 +1171,7 @@ class vmmCreate(vmmGObjectUI):
|
||||
|
||||
def build_guest(self, installer, name):
|
||||
guest = installer.guest_from_installer()
|
||||
guest.name = self.get_config_name()
|
||||
guest.name = name
|
||||
|
||||
# Generate UUID
|
||||
try:
|
||||
@ -1504,7 +1504,7 @@ class vmmCreate(vmmGObjectUI):
|
||||
def reset_guest_type(self):
|
||||
self.change_caps()
|
||||
|
||||
def finish(self, src):
|
||||
def finish(self, src_ignore):
|
||||
# Validate the final page
|
||||
page = self.window.get_widget("create-pages").get_current_page()
|
||||
if self.validate(page) != True:
|
||||
|
@ -212,7 +212,7 @@ class vmmCreateNetwork(vmmGObjectUI):
|
||||
green = gtk.gdk.color_parse("#c0ffc0")
|
||||
src.modify_base(gtk.STATE_NORMAL, green)
|
||||
|
||||
def change_forward_type(self, src):
|
||||
def change_forward_type(self, src_ignore):
|
||||
skip_fwd = self.window.get_widget("net-forward-none").get_active()
|
||||
|
||||
self.window.get_widget("net-forward-mode").set_sensitive(not skip_fwd)
|
||||
@ -255,7 +255,7 @@ class vmmCreateNetwork(vmmGObjectUI):
|
||||
def get_config_dhcp_enable(self):
|
||||
return self.window.get_widget("net-dhcp-enable").get_active()
|
||||
|
||||
def page_changed(self, notebook, page, page_number):
|
||||
def page_changed(self, notebook_ignore, page_ignore, page_number):
|
||||
# would you like some spaghetti with your salad, sir?
|
||||
|
||||
if page_number == PAGE_INTRO:
|
||||
@ -414,7 +414,7 @@ class vmmCreateNetwork(vmmGObjectUI):
|
||||
self.window.get_widget("create-back").set_sensitive(True)
|
||||
return True
|
||||
|
||||
def show_help(self, src):
|
||||
def show_help(self, src_ignore):
|
||||
# help to show depends on the notebook page, yahoo
|
||||
page = self.window.get_widget("create-pages").get_current_page()
|
||||
if page == PAGE_INTRO:
|
||||
|
@ -426,7 +426,7 @@ class vmmCreatePool(vmmGObjectUI):
|
||||
details = "".join(traceback.format_exc())
|
||||
asyncjob.set_error(error, details)
|
||||
|
||||
def page_changed(self, notebook, page, page_number):
|
||||
def page_changed(self, notebook_ignore, page_ignore, page_number):
|
||||
if page_number == PAGE_NAME:
|
||||
self.window.get_widget("pool-back").set_sensitive(False)
|
||||
self.window.get_widget("pool-finish").hide()
|
||||
|
@ -187,8 +187,7 @@ class vmmCreateVolume(vmmGObjectUI):
|
||||
if cap < alloc:
|
||||
alloc_widget.set_value(cap)
|
||||
|
||||
def finish(self, src):
|
||||
# validate input
|
||||
def finish(self, src_ignore):
|
||||
try:
|
||||
if not self.validate():
|
||||
return
|
||||
|
@ -44,7 +44,7 @@ class vmmDeleteDialog(vmmGObjectUI):
|
||||
__gsignals__ = {
|
||||
}
|
||||
|
||||
def __init__(self, config, vm):
|
||||
def __init__(self, vm):
|
||||
vmmGObjectUI.__init__(self, "vmm-delete.glade", "vmm-delete")
|
||||
self.vm = vm
|
||||
self.conn = vm.connection
|
||||
@ -119,7 +119,7 @@ class vmmDeleteDialog(vmmGObjectUI):
|
||||
paths.append(row[STORAGE_ROW_PATH])
|
||||
return paths
|
||||
|
||||
def finish(self, src):
|
||||
def finish(self, src_ignore):
|
||||
devs = self.get_paths_to_delete()
|
||||
|
||||
self.topwin.set_sensitive(False)
|
||||
|
@ -713,6 +713,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.vm.set_details_window_size(event.width, event.height)
|
||||
|
||||
def popup_addhw_menu(self, widget, event):
|
||||
ignore = widget
|
||||
if event.button != 3:
|
||||
return
|
||||
|
||||
@ -836,7 +837,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
|
||||
return page
|
||||
|
||||
def hw_selected(self, src=None, page=None, selected=True):
|
||||
def hw_selected(self, ignore1=None, page=None, selected=True):
|
||||
pagetype = self.force_get_hw_pagetype(page)
|
||||
|
||||
self.window.get_widget("config-remove").set_sensitive(True)
|
||||
@ -998,13 +999,13 @@ class vmmDetails(vmmGObjectUI):
|
||||
# External action listeners #
|
||||
#############################
|
||||
|
||||
def show_help(self, src):
|
||||
def show_help(self, src_ignore):
|
||||
self.emit("action-show-help", "virt-manager-details-window")
|
||||
|
||||
def view_manager(self, src):
|
||||
def view_manager(self, src_ignore):
|
||||
self.emit("action-view-manager")
|
||||
|
||||
def exit_app(self, src):
|
||||
def exit_app(self, src_ignore):
|
||||
self.emit("action-exit-app")
|
||||
|
||||
def activate_console_page(self):
|
||||
@ -1017,13 +1018,13 @@ class vmmDetails(vmmGObjectUI):
|
||||
def activate_config_page(self):
|
||||
self.window.get_widget("details-pages").set_current_page(PAGE_DETAILS)
|
||||
|
||||
def add_hardware(self, src):
|
||||
def add_hardware(self, src_ignore):
|
||||
if self.addhw is None:
|
||||
self.addhw = vmmAddHardware(self.vm)
|
||||
|
||||
self.addhw.show()
|
||||
|
||||
def remove_xml_dev(self, src):
|
||||
def remove_xml_dev(self, src_ignore):
|
||||
info = self.get_hw_selection(HW_LIST_COL_DEVICE)
|
||||
if not info:
|
||||
return
|
||||
@ -1036,45 +1037,56 @@ class vmmDetails(vmmGObjectUI):
|
||||
return
|
||||
|
||||
if src.get_active():
|
||||
self.emit("action-suspend-domain", self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
self.emit("action-suspend-domain",
|
||||
self.vm.get_connection().get_uri(),
|
||||
self.vm.get_uuid())
|
||||
else:
|
||||
self.emit("action-resume-domain", self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
self.emit("action-resume-domain",
|
||||
self.vm.get_connection().get_uri(),
|
||||
self.vm.get_uuid())
|
||||
|
||||
def control_vm_run(self, src):
|
||||
self.emit("action-run-domain", self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
def control_vm_run(self, src_ignore):
|
||||
self.emit("action-run-domain",
|
||||
self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
|
||||
def control_vm_shutdown(self, src):
|
||||
self.emit("action-shutdown-domain", self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
def control_vm_shutdown(self, src_ignore):
|
||||
self.emit("action-shutdown-domain",
|
||||
self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
|
||||
def control_vm_reboot(self, src):
|
||||
self.emit("action-reboot-domain", self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
def control_vm_reboot(self, src_ignore):
|
||||
self.emit("action-reboot-domain",
|
||||
self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
|
||||
def control_vm_console(self, src):
|
||||
self.emit("action-show-console", self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
def control_vm_console(self, src_ignore):
|
||||
self.emit("action-show-console",
|
||||
self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
|
||||
def control_vm_save(self, src):
|
||||
self.emit("action-save-domain", self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
def control_vm_save(self, src_ignore):
|
||||
self.emit("action-save-domain",
|
||||
self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
|
||||
def control_vm_destroy(self, src):
|
||||
self.emit("action-destroy-domain", self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
def control_vm_destroy(self, src_ignore):
|
||||
self.emit("action-destroy-domain",
|
||||
self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
|
||||
def control_vm_clone(self, src):
|
||||
self.emit("action-clone-domain", self.vm.get_connection().get_uri(),
|
||||
self.vm.get_uuid())
|
||||
def control_vm_clone(self, src_ignore):
|
||||
self.emit("action-clone-domain",
|
||||
self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
|
||||
def control_vm_migrate(self, src):
|
||||
self.emit("action-migrate-domain", self.vm.get_connection().get_uri(),
|
||||
self.vm.get_uuid())
|
||||
def control_vm_migrate(self, src_ignore):
|
||||
self.emit("action-migrate-domain",
|
||||
self.vm.get_connection().get_uri(), self.vm.get_uuid())
|
||||
|
||||
def control_vm_screenshot(self, src):
|
||||
def control_vm_screenshot(self, src_ignore):
|
||||
# If someone feels kind they could extend this code to allow
|
||||
# user to choose what image format they'd like to save in....
|
||||
path = util.browse_local(self.topwin,
|
||||
_("Save Virtual Machine Screenshot"),
|
||||
self.config, self.vm.get_connection(),
|
||||
_type = ("png", "PNG files"),
|
||||
dialog_type = gtk.FILE_CHOOSER_ACTION_SAVE,
|
||||
browse_reason=self.config.CONFIG_DIR_SCREENSHOT)
|
||||
path = util.browse_local(
|
||||
self.topwin,
|
||||
_("Save Virtual Machine Screenshot"),
|
||||
self.config, self.vm.get_connection(),
|
||||
_type = ("png", "PNG files"),
|
||||
dialog_type = gtk.FILE_CHOOSER_ACTION_SAVE,
|
||||
browse_reason=self.config.CONFIG_DIR_SCREENSHOT)
|
||||
if not path:
|
||||
return
|
||||
|
||||
@ -1106,7 +1118,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
# Serial Console pieces
|
||||
# ------------------------------
|
||||
|
||||
def control_serial_tab(self, src, name, target_port):
|
||||
def control_serial_tab(self, src_ignore, name, target_port):
|
||||
is_graphics = (name == "graphics")
|
||||
is_serial = not is_graphics
|
||||
|
||||
@ -1131,16 +1143,16 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.serial_copy.set_sensitive(False)
|
||||
self.serial_popup.popup(None, None, None, 0, event.time)
|
||||
|
||||
def serial_close_tab(self, src, pagenum):
|
||||
def serial_close_tab(self, src_ignore, pagenum):
|
||||
tab_idx = (pagenum - PAGE_DYNAMIC_OFFSET)
|
||||
if (tab_idx < 0) or (tab_idx > len(self.serial_tabs)-1):
|
||||
return
|
||||
return self._close_serial_tab(self.serial_tabs[tab_idx])
|
||||
|
||||
def serial_copy_text(self, src, terminal):
|
||||
def serial_copy_text(self, src_ignore, terminal):
|
||||
terminal.copy_clipboard()
|
||||
|
||||
def serial_paste_text(self, src, terminal):
|
||||
def serial_paste_text(self, src_ignore, terminal):
|
||||
terminal.paste_clipboard()
|
||||
|
||||
def _show_serial_tab(self, name, target_port):
|
||||
@ -1196,10 +1208,10 @@ class vmmDetails(vmmGObjectUI):
|
||||
show_type = (val.lower() != "none")
|
||||
self.window.get_widget("security-type-box").set_sensitive(show_type)
|
||||
|
||||
def security_label_changed(self, label):
|
||||
def security_label_changed(self, label_ignore):
|
||||
self.window.get_widget("config-apply").set_sensitive(True)
|
||||
|
||||
def security_type_changed(self, button, sensitive = True):
|
||||
def security_type_changed(self, button):
|
||||
self.window.get_widget("config-apply").set_sensitive(True)
|
||||
self.window.get_widget("security-label").set_sensitive(not button.get_active())
|
||||
|
||||
@ -1222,10 +1234,10 @@ class vmmDetails(vmmGObjectUI):
|
||||
mem = memadj.value
|
||||
return mem
|
||||
|
||||
def config_maxmem_changed(self, src):
|
||||
def config_maxmem_changed(self, src_ignore):
|
||||
self.window.get_widget("config-apply").set_sensitive(True)
|
||||
|
||||
def config_memory_changed(self, src):
|
||||
def config_memory_changed(self, src_ignore):
|
||||
self.window.get_widget("config-apply").set_sensitive(True)
|
||||
|
||||
maxadj = self.window.get_widget("config-maxmem").get_adjustment()
|
||||
@ -1289,7 +1301,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
boot_row[BOOT_DEV_TYPE])
|
||||
self.config_enable_apply()
|
||||
|
||||
def config_boot_move(self, src, move_up):
|
||||
def config_boot_move(self, src_ignore, move_up):
|
||||
boot_row = self.get_boot_selection()
|
||||
if not boot_row:
|
||||
return
|
||||
@ -1314,7 +1326,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.config_enable_apply()
|
||||
|
||||
# CDROM Eject/Connect
|
||||
def toggle_storage_media(self, src):
|
||||
def toggle_storage_media(self, src_ignore):
|
||||
disk = self.get_hw_selection(HW_LIST_COL_DEVICE)
|
||||
if not disk:
|
||||
return
|
||||
@ -1328,7 +1340,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.change_storage_media(dev_id_info, None)
|
||||
return
|
||||
|
||||
def change_cdrom_wrapper(src, dev_id_info, newpath):
|
||||
def change_cdrom_wrapper(src_ignore, dev_id_info, newpath):
|
||||
return self.change_storage_media(dev_id_info, newpath)
|
||||
|
||||
# Launch 'Choose CD' dialog
|
||||
@ -1447,7 +1459,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.vm.hotplug_vcpus,
|
||||
(vcpus,))
|
||||
|
||||
def config_vcpu_pin(self, src, path, new_text):
|
||||
def config_vcpu_pin(self, src_ignore, path, new_text):
|
||||
vcpu_list = self.window.get_widget("config-vcpu-list")
|
||||
vcpu_model = vcpu_list.get_model()
|
||||
row = vcpu_model[path]
|
||||
@ -1771,11 +1783,11 @@ class vmmDetails(vmmGObjectUI):
|
||||
def _dsk_rx_tx_text(rx, tx, unit):
|
||||
return ('<span color="#82003B">%(rx)d %(unit)s read</span>\n'
|
||||
'<span color="#295C45">%(tx)d %(unit)s write</span>' %
|
||||
locals())
|
||||
{"rx": rx, "tx": tx, "unit": unit})
|
||||
def _net_rx_tx_text(rx, tx, unit):
|
||||
return ('<span color="#82003B">%(rx)d %(unit)s in</span>\n'
|
||||
'<span color="#295C45">%(tx)d %(unit)s out</span>' %
|
||||
locals())
|
||||
{"rx": rx, "tx": tx, "unit": unit})
|
||||
|
||||
cpu_txt = _("Disabled")
|
||||
mem_txt = _("Disabled")
|
||||
|
@ -445,6 +445,7 @@ class vmmDomainBase(vmmLibvirtObject):
|
||||
xml = self.get_xml()
|
||||
|
||||
def get_boot_xml(doc, ctx):
|
||||
ignore = doc
|
||||
ret = ctx.xpathEval("/domain/os/boot")
|
||||
devs = []
|
||||
for node in ret:
|
||||
@ -1130,6 +1131,8 @@ class vmmDomain(vmmDomainBase):
|
||||
########################
|
||||
|
||||
def _update_start_vcpus(self, ignore, oldstatus, status):
|
||||
ignore = status
|
||||
|
||||
if oldstatus not in [ libvirt.VIR_DOMAIN_SHUTDOWN,
|
||||
libvirt.VIR_DOMAIN_SHUTOFF,
|
||||
libvirt.VIR_DOMAIN_CRASHED ]:
|
||||
@ -1356,6 +1359,7 @@ class vmmDomainVirtinst(vmmDomainBase):
|
||||
return self._backend
|
||||
|
||||
def _define(self, newxml):
|
||||
ignore = newxml
|
||||
self._orig_xml = None
|
||||
util.safe_idle_add(util.idle_emit, self, "config-changed")
|
||||
|
||||
|
@ -178,6 +178,9 @@ def packagekit_search(session, pk_control, package_name):
|
||||
|
||||
found = []
|
||||
def package(info, package_id, summary):
|
||||
ignore = info
|
||||
ignore = summary
|
||||
|
||||
found_name = str(package_id.split(";")[0])
|
||||
if found_name in PACKAGEKIT_PACKAGES:
|
||||
found.append(found_name)
|
||||
@ -186,7 +189,7 @@ def packagekit_search(session, pk_control, package_name):
|
||||
raise RuntimeError("PackageKit search failure: %s %s" %
|
||||
(code, details))
|
||||
|
||||
def finished(ignore, runtime):
|
||||
def finished(ignore, runtime_ignore):
|
||||
gtk.main_quit()
|
||||
|
||||
pk_trans.connect_to_signal('Finished', finished)
|
||||
@ -375,16 +378,17 @@ class vmmEngine(gobject.GObject):
|
||||
logging.exception("Error connecting to %s" % uri)
|
||||
return None
|
||||
|
||||
def _do_connect(self, src, uri):
|
||||
def _do_connect(self, src_ignore, uri):
|
||||
return self.connect_to_uri(uri)
|
||||
|
||||
def _connect_cancelled(self, connect):
|
||||
def _connect_cancelled(self, connect_ignore):
|
||||
self.windowConnect = None
|
||||
if len(self.connections.keys()) == 0:
|
||||
self.exit_app()
|
||||
|
||||
|
||||
def _do_vm_removed(self, connection, hvuri, vmuuid):
|
||||
ignore = connection
|
||||
if self.connections[hvuri]["windowDetails"].has_key(vmuuid):
|
||||
self.connections[hvuri]["windowDetails"][vmuuid].close()
|
||||
del self.connections[hvuri]["windowDetails"][vmuuid]
|
||||
@ -606,7 +610,7 @@ class vmmEngine(gobject.GObject):
|
||||
if self.windowConnect:
|
||||
return self.windowConnect
|
||||
|
||||
def connect_wrap(src, *args):
|
||||
def connect_wrap(src_ignore, *args):
|
||||
return self.connect_to_uri(*args)
|
||||
|
||||
obj = vmmConnect()
|
||||
|
@ -134,6 +134,10 @@ class CellRendererSparkline(gtk.CellRenderer):
|
||||
# flags : flags that affect rendering
|
||||
# flags = gtk.CELL_RENDERER_SELECTED, gtk.CELL_RENDERER_PRELIT,
|
||||
# gtk.CELL_RENDERER_INSENSITIVE or gtk.CELL_RENDERER_SORTED
|
||||
ignore = widget
|
||||
ignore = expose_area
|
||||
ignore = background_area
|
||||
ignore = flags
|
||||
|
||||
# Indent of the gray border around the graph
|
||||
BORDER_PADDING = 2
|
||||
@ -235,6 +239,8 @@ class CellRendererSparkline(gtk.CellRenderer):
|
||||
return
|
||||
|
||||
def do_get_size(self, widget, cell_area=None):
|
||||
ignore = widget
|
||||
|
||||
FIXED_WIDTH = len(self.data_array)
|
||||
FIXED_HEIGHT = 15
|
||||
xpad = self.get_property("xpad")
|
||||
@ -313,6 +319,7 @@ class Sparkline(gtk.DrawingArea):
|
||||
# event : GdkEvent
|
||||
# cell_area : GdkRectangle: area normally rendered by cell
|
||||
# window : gtk.gdk.Window (not plain window)
|
||||
ignore = event
|
||||
|
||||
# cell_area : GdkRectangle: area normally rendered by cell
|
||||
cell_area = widget.allocation
|
||||
|
@ -283,7 +283,7 @@ class vmmHalHelper(gobject.GObject):
|
||||
gobject.type_register(vmmHalHelper)
|
||||
|
||||
|
||||
def get_net_bridge_owner(name, sysfspath):
|
||||
def get_net_bridge_owner(name_ignore, sysfspath):
|
||||
# Now magic to determine if the device is part of a bridge
|
||||
brportpath = os.path.join(sysfspath, "brport")
|
||||
|
||||
@ -300,7 +300,7 @@ def get_net_bridge_owner(name, sysfspath):
|
||||
traceback.format_exc (stacktrace))
|
||||
return None
|
||||
|
||||
def get_net_mac_address(name, sysfspath):
|
||||
def get_net_mac_address(name_ignore, sysfspath):
|
||||
mac = None
|
||||
addrpath = sysfspath + "/address"
|
||||
if os.path.exists(addrpath):
|
||||
@ -323,7 +323,7 @@ def get_bonding_masters():
|
||||
masters = rline[:].split(' ')
|
||||
return masters
|
||||
|
||||
def is_net_bonding_slave(name, sysfspath):
|
||||
def is_net_bonding_slave(name_ignore, sysfspath):
|
||||
masterpath = sysfspath + "/master"
|
||||
if os.path.exists(masterpath):
|
||||
return True
|
||||
|
@ -305,16 +305,16 @@ class vmmHost(vmmGObjectUI):
|
||||
self.engine.decrement_window_counter()
|
||||
return 1
|
||||
|
||||
def show_help(self, src):
|
||||
def show_help(self, src_ignore):
|
||||
self.emit("action-show-help", "virt-manager-host-window")
|
||||
|
||||
def view_manager(self, src):
|
||||
def view_manager(self, src_ignore):
|
||||
self.emit("action-view-manager")
|
||||
|
||||
def restore_domain(self, src):
|
||||
def restore_domain(self, src_ignore):
|
||||
self.emit("action-restore-domain", self.conn.get_uri())
|
||||
|
||||
def exit_app(self, src):
|
||||
def exit_app(self, src_ignore):
|
||||
self.emit("action-exit-app")
|
||||
|
||||
def reset_state(self):
|
||||
@ -373,7 +373,7 @@ class vmmHost(vmmGObjectUI):
|
||||
# Virtual Network functions
|
||||
# -------------------------
|
||||
|
||||
def delete_network(self, src):
|
||||
def delete_network(self, src_ignore):
|
||||
net = self.current_network()
|
||||
if net is None:
|
||||
return
|
||||
@ -388,7 +388,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.err.show_err(_("Error deleting network: %s") % str(e),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def start_network(self, src):
|
||||
def start_network(self, src_ignore):
|
||||
net = self.current_network()
|
||||
if net is None:
|
||||
return
|
||||
@ -399,7 +399,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.err.show_err(_("Error starting network: %s") % str(e),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def stop_network(self, src):
|
||||
def stop_network(self, src_ignore):
|
||||
net = self.current_network()
|
||||
if net is None:
|
||||
return
|
||||
@ -410,7 +410,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.err.show_err(_("Error stopping network: %s") % str(e),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def add_network(self, src):
|
||||
def add_network(self, src_ignore):
|
||||
try:
|
||||
if self.addnet is None:
|
||||
self.addnet = vmmCreateNetwork(self.conn)
|
||||
@ -419,7 +419,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.err.show_err(_("Error launching network wizard: %s") % str(e),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def net_apply(self, src):
|
||||
def net_apply(self, src_ignore):
|
||||
net = self.current_network()
|
||||
if net is None:
|
||||
return
|
||||
@ -432,7 +432,7 @@ class vmmHost(vmmGObjectUI):
|
||||
return
|
||||
self.window.get_widget("net-apply").set_sensitive(False)
|
||||
|
||||
def net_autostart_changed(self, src):
|
||||
def net_autostart_changed(self, src_ignore):
|
||||
auto = self.window.get_widget("net-autostart").get_active()
|
||||
self.window.get_widget("net-autostart").set_label(auto and \
|
||||
_("On Boot") or \
|
||||
@ -447,7 +447,7 @@ class vmmHost(vmmGObjectUI):
|
||||
return self.conn.get_net(curruuid)
|
||||
return None
|
||||
|
||||
def refresh_network(self, src, uri, uuid):
|
||||
def refresh_network(self, src_ignore, uri_ignore, uuid):
|
||||
sel = self.window.get_widget("net-list").get_selection()
|
||||
active = sel.get_selected()
|
||||
if active[1] != None:
|
||||
@ -542,7 +542,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.window.get_widget("net-ip4-forwarding").set_text(_("Isolated virtual network"))
|
||||
self.window.get_widget("net-apply").set_sensitive(False)
|
||||
|
||||
def repopulate_networks(self, src, uri, uuid):
|
||||
def repopulate_networks(self, src_ignore, uri_ignore, uuid_ignore):
|
||||
self.populate_networks(self.window.get_widget("net-list").get_model())
|
||||
|
||||
def populate_networks(self, model):
|
||||
@ -565,7 +565,7 @@ class vmmHost(vmmGObjectUI):
|
||||
# ------------------------------
|
||||
|
||||
|
||||
def stop_pool(self, src):
|
||||
def stop_pool(self, src_ignore):
|
||||
pool = self.current_pool()
|
||||
if pool is not None:
|
||||
try:
|
||||
@ -575,7 +575,7 @@ class vmmHost(vmmGObjectUI):
|
||||
(pool.get_name(), str(e)),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def start_pool(self, src):
|
||||
def start_pool(self, src_ignore):
|
||||
pool = self.current_pool()
|
||||
if pool is not None:
|
||||
try:
|
||||
@ -585,7 +585,7 @@ class vmmHost(vmmGObjectUI):
|
||||
(pool.get_name(), str(e)),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def delete_pool(self, src):
|
||||
def delete_pool(self, src_ignore):
|
||||
pool = self.current_pool()
|
||||
if pool is None:
|
||||
return
|
||||
@ -600,7 +600,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.err.show_err(_("Error deleting pool: %s") % str(e),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def pool_refresh(self, src):
|
||||
def pool_refresh(self, src_ignore):
|
||||
pool = self.current_pool()
|
||||
if pool is None:
|
||||
return
|
||||
@ -613,7 +613,7 @@ class vmmHost(vmmGObjectUI):
|
||||
(pool.get_name(), str(e)),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def delete_vol(self, src):
|
||||
def delete_vol(self, src_ignore):
|
||||
vol = self.current_vol()
|
||||
if vol is None:
|
||||
return
|
||||
@ -632,7 +632,7 @@ class vmmHost(vmmGObjectUI):
|
||||
return
|
||||
self.populate_storage_volumes()
|
||||
|
||||
def add_pool(self, src):
|
||||
def add_pool(self, src_ignore):
|
||||
try:
|
||||
if self.addpool is None:
|
||||
self.addpool = vmmCreatePool(self.conn)
|
||||
@ -641,7 +641,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.err.show_err(_("Error launching pool wizard: %s") % str(e),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def add_vol(self, src):
|
||||
def add_vol(self, src_ignore):
|
||||
pool = self.current_pool()
|
||||
if pool is None:
|
||||
return
|
||||
@ -682,23 +682,24 @@ class vmmHost(vmmGObjectUI):
|
||||
return pool.get_volume(curruuid)
|
||||
return None
|
||||
|
||||
def pool_apply(self, src):
|
||||
def pool_apply(self, src_ignore):
|
||||
pool = self.current_pool()
|
||||
if pool is None:
|
||||
return
|
||||
|
||||
try:
|
||||
pool.set_autostart(self.window.get_widget("pool-autostart").get_active())
|
||||
do_auto = self.window.get_widget("pool-autostart").get_active()
|
||||
pool.set_autostart(do_auto)
|
||||
except Exception, e:
|
||||
self.err.show_err(_("Error setting pool autostart: %s") % str(e),
|
||||
"".join(traceback.format_exc()))
|
||||
return
|
||||
self.window.get_widget("pool-apply").set_sensitive(False)
|
||||
|
||||
def pool_autostart_changed(self, src):
|
||||
def pool_autostart_changed(self, src_ignore):
|
||||
auto = self.window.get_widget("pool-autostart").get_active()
|
||||
self.window.get_widget("pool-autostart").set_label(auto and \
|
||||
_("On Boot") or \
|
||||
self.window.get_widget("pool-autostart").set_label(auto and
|
||||
_("On Boot") or
|
||||
_("Never"))
|
||||
self.window.get_widget("pool-apply").set_sensitive(True)
|
||||
|
||||
@ -751,7 +752,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.window.get_widget("vol-add").set_sensitive(active)
|
||||
self.window.get_widget("vol-delete").set_sensitive(False)
|
||||
|
||||
def refresh_storage_pool(self, src, uri, uuid):
|
||||
def refresh_storage_pool(self, src_ignore, uri_ignore, uuid):
|
||||
refresh_pool_in_list(self.window.get_widget("pool-list"),
|
||||
self.conn, uuid)
|
||||
curpool = self.current_pool()
|
||||
@ -791,7 +792,7 @@ class vmmHost(vmmGObjectUI):
|
||||
|
||||
self.window.get_widget("vol-delete").set_sensitive(True)
|
||||
|
||||
def popup_vol_menu(self, widget, event):
|
||||
def popup_vol_menu(self, widget_ignore, event):
|
||||
if event.button != 3:
|
||||
return
|
||||
|
||||
@ -807,7 +808,7 @@ class vmmHost(vmmGObjectUI):
|
||||
clipboard.set_text(target_path)
|
||||
|
||||
|
||||
def repopulate_storage_pools(self, src, uri, uuid):
|
||||
def repopulate_storage_pools(self, src_ignore, uri_ignore, uuid_ignore):
|
||||
pool_list = self.window.get_widget("pool-list")
|
||||
populate_storage_pools(pool_list, self.conn)
|
||||
|
||||
@ -826,7 +827,7 @@ class vmmHost(vmmGObjectUI):
|
||||
# Interface manager methods #
|
||||
#############################
|
||||
|
||||
def stop_interface(self, src):
|
||||
def stop_interface(self, src_ignore):
|
||||
interface = self.current_interface()
|
||||
if interface is None:
|
||||
return
|
||||
@ -852,7 +853,7 @@ class vmmHost(vmmGObjectUI):
|
||||
(interface.get_name(), str(e)),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def start_interface(self, src):
|
||||
def start_interface(self, src_ignore):
|
||||
interface = self.current_interface()
|
||||
if interface is None:
|
||||
return
|
||||
@ -878,7 +879,7 @@ class vmmHost(vmmGObjectUI):
|
||||
(interface.get_name(), str(e)),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def delete_interface(self, src):
|
||||
def delete_interface(self, src_ignore):
|
||||
interface = self.current_interface()
|
||||
if interface is None:
|
||||
return
|
||||
@ -895,7 +896,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.err.show_err(_("Error deleting interface: %s") % str(e),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def add_interface(self, src):
|
||||
def add_interface(self, src_ignore):
|
||||
try:
|
||||
if self.addinterface is None:
|
||||
self.addinterface = vmmCreateInterface(self.conn)
|
||||
@ -920,7 +921,7 @@ class vmmHost(vmmGObjectUI):
|
||||
|
||||
return None
|
||||
|
||||
def interface_apply(self, src):
|
||||
def interface_apply(self, src_ignore):
|
||||
interface = self.current_interface()
|
||||
if interface is None:
|
||||
return
|
||||
@ -939,7 +940,7 @@ class vmmHost(vmmGObjectUI):
|
||||
# XXX: This will require an interface restart
|
||||
self.window.get_widget("interface-apply").set_sensitive(False)
|
||||
|
||||
def interface_startmode_changed(self, src):
|
||||
def interface_startmode_changed(self, src_ignore):
|
||||
self.window.get_widget("interface-apply").set_sensitive(True)
|
||||
|
||||
def set_interface_error_page(self, msg):
|
||||
@ -1049,7 +1050,7 @@ class vmmHost(vmmGObjectUI):
|
||||
show_child)
|
||||
self.populate_interface_children()
|
||||
|
||||
def refresh_interface(self, src, uri, name):
|
||||
def refresh_interface(self, src_ignore, uri_ignore, name):
|
||||
iface_list = self.window.get_widget("interface-list")
|
||||
sel = iface_list.get_selection()
|
||||
active = sel.get_selected()
|
||||
@ -1072,7 +1073,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.window.get_widget("interface-start").set_sensitive(False)
|
||||
self.window.get_widget("interface-apply").set_sensitive(False)
|
||||
|
||||
def repopulate_interfaces(self, src, uri, name):
|
||||
def repopulate_interfaces(self, src_ignore, uri_ignore, name_ignore):
|
||||
interface_list = self.window.get_widget("interface-list")
|
||||
self.populate_interfaces(interface_list.get_model())
|
||||
|
||||
|
@ -213,7 +213,7 @@ class vmmManager(vmmGObjectUI):
|
||||
|
||||
self.engine.increment_window_counter()
|
||||
|
||||
def close(self, src=None, src2=None):
|
||||
def close(self, src_ignore=None, src2_ignore=None):
|
||||
if not self.is_visible():
|
||||
return
|
||||
|
||||
@ -506,25 +506,25 @@ class vmmManager(vmmGObjectUI):
|
||||
|
||||
self.config.set_manager_window_size(event.width, event.height)
|
||||
|
||||
def exit_app(self, src=None, src2=None):
|
||||
def exit_app(self, src_ignore=None, src2_ignore=None):
|
||||
self.emit("action-exit-app")
|
||||
|
||||
def new_connection(self, src=None):
|
||||
def new_connection(self, src_ignore=None):
|
||||
self.emit("action-show-connect")
|
||||
|
||||
def new_vm(self, ignore=None):
|
||||
def new_vm(self, src_ignore=None):
|
||||
self.emit("action-show-create", self.current_connection_uri())
|
||||
|
||||
def show_about(self, src):
|
||||
def show_about(self, src_ignore):
|
||||
self.emit("action-show-about")
|
||||
|
||||
def show_help(self, src):
|
||||
def show_help(self, src_ignore):
|
||||
self.emit("action-show-help", None)
|
||||
|
||||
def show_preferences(self, src):
|
||||
def show_preferences(self, src_ignore):
|
||||
self.emit("action-show-preferences")
|
||||
|
||||
def show_host(self, src):
|
||||
def show_host(self, src_ignore):
|
||||
uri = self.current_connection_uri(default_selection=True)
|
||||
self.emit("action-show-host", uri)
|
||||
|
||||
@ -689,7 +689,7 @@ class vmmManager(vmmGObjectUI):
|
||||
def vm_row_key(self, vm):
|
||||
return vm.get_uuid() + ":" + vm.get_connection().get_uri()
|
||||
|
||||
def vm_added(self, connection, uri, vmuuid):
|
||||
def vm_added(self, connection, uri_ignore, vmuuid):
|
||||
vm = connection.get_vm(vmuuid)
|
||||
vm.connect("status-changed", self.vm_status_changed)
|
||||
vm.connect("resources-sampled", self.vm_resources_sampled)
|
||||
@ -699,7 +699,7 @@ class vmmManager(vmmGObjectUI):
|
||||
|
||||
self._append_vm(model, vm, connection)
|
||||
|
||||
def vm_removed(self, connection, uri, vmuuid):
|
||||
def vm_removed(self, connection, uri_ignore, vmuuid):
|
||||
vmlist = self.window.get_widget("vm-list")
|
||||
model = vmlist.get_model()
|
||||
|
||||
@ -751,6 +751,7 @@ class vmmManager(vmmGObjectUI):
|
||||
return color
|
||||
|
||||
def _build_vm_markup(self, vm, row):
|
||||
ignore = vm
|
||||
domtext = ("<span size='smaller' weight='bold'>%s</span>" %
|
||||
row[ROW_NAME])
|
||||
statetext = "<span size='smaller'>%s</span>" % row[ROW_STATUS]
|
||||
@ -806,7 +807,7 @@ class vmmManager(vmmGObjectUI):
|
||||
self.rows[conn.get_uri()] = model[path]
|
||||
return _iter
|
||||
|
||||
def _add_connection(self, engine, conn):
|
||||
def _add_connection(self, engine_ignore, conn):
|
||||
# Make sure error page isn't showing
|
||||
self.window.get_widget("vm-notebook").set_current_page(0)
|
||||
|
||||
@ -825,7 +826,7 @@ class vmmManager(vmmGObjectUI):
|
||||
row = self._append_connection(vmlist.get_model(), conn)
|
||||
vmlist.get_selection().select_iter(row)
|
||||
|
||||
def _remove_connection(self, engine, conn):
|
||||
def _remove_connection(self, engine_ignore, conn):
|
||||
model = self.window.get_widget("vm-list").get_model()
|
||||
parent = self.rows[conn.get_uri()].iter
|
||||
if parent is not None:
|
||||
@ -842,7 +843,7 @@ class vmmManager(vmmGObjectUI):
|
||||
# State/UI updating methods #
|
||||
#############################
|
||||
|
||||
def vm_status_changed(self, vm, status, ignore):
|
||||
def vm_status_changed(self, vm, status_ignore, oldstatus_ignore):
|
||||
parent = self.rows[vm.get_connection().get_uri()].iter
|
||||
|
||||
vmlist = self.window.get_widget("vm-list")
|
||||
@ -944,7 +945,7 @@ class vmmManager(vmmGObjectUI):
|
||||
self.window.get_widget("menu_host_details").set_sensitive(host_details)
|
||||
self.window.get_widget("menu_edit_delete").set_sensitive(delete)
|
||||
|
||||
def popup_vm_menu_key(self, widget, event):
|
||||
def popup_vm_menu_key(self, widget_ignore, event):
|
||||
if gtk.gdk.keyval_name(event.keyval) != "Menu":
|
||||
return False
|
||||
|
||||
@ -1069,19 +1070,19 @@ class vmmManager(vmmGObjectUI):
|
||||
}
|
||||
set_stats[stats_id](visible)
|
||||
|
||||
def cpu_usage_img(self, column, cell, model, _iter, data):
|
||||
def cpu_usage_img(self, column_ignore, cell, model, _iter, data):
|
||||
if model.get_value(_iter, ROW_HANDLE) is None:
|
||||
return
|
||||
data = model.get_value(_iter, ROW_HANDLE).cpu_time_vector_limit(40)
|
||||
cell.set_property('data_array', data)
|
||||
|
||||
def disk_io_img(self, column, cell, model, _iter, data):
|
||||
def disk_io_img(self, column_ignore, cell, model, _iter, data):
|
||||
if model.get_value(_iter, ROW_HANDLE) is None:
|
||||
return
|
||||
data = model.get_value(_iter, ROW_HANDLE).disk_io_vector_limit(40)
|
||||
cell.set_property('data_array', data)
|
||||
|
||||
def network_traffic_img(self, column, cell, model, _iter, data):
|
||||
def network_traffic_img(self, column_ignore, cell, model, _iter, data):
|
||||
if model.get_value(_iter, ROW_HANDLE) is None:
|
||||
return
|
||||
data = model.get_value(_iter, ROW_HANDLE).network_traffic_vector_limit(40)
|
||||
|
@ -50,7 +50,7 @@ class vmmMigrateDialog(vmmGObjectUI):
|
||||
__gsignals__ = {
|
||||
}
|
||||
|
||||
def __init__(self, config, vm, engine):
|
||||
def __init__(self, vm, engine):
|
||||
vmmGObjectUI.__init__(self, "vmm-migrate.glade", "vmm-migrate")
|
||||
self.vm = vm
|
||||
self.conn = vm.connection
|
||||
@ -413,7 +413,7 @@ class vmmMigrateDialog(vmmGObjectUI):
|
||||
|
||||
return True
|
||||
|
||||
def finish(self, src):
|
||||
def finish(self, src_ignore):
|
||||
try:
|
||||
if not self.validate():
|
||||
return
|
||||
|
@ -195,7 +195,7 @@ class vmmPreferences(vmmGObjectUI):
|
||||
keystr = ""
|
||||
return keystr
|
||||
|
||||
def grabkeys_dlg_press(self, src, ev, defs):
|
||||
def grabkeys_dlg_press(self, src_ignore, ev, defs):
|
||||
label = defs['label']
|
||||
# Try to get the index, it fails when not found
|
||||
try:
|
||||
@ -205,12 +205,12 @@ class vmmPreferences(vmmGObjectUI):
|
||||
|
||||
label.set_text( self.grabkeys_get_string(defs['keysyms']) )
|
||||
|
||||
def grabkeys_dlg_release(self, src, ev, defs):
|
||||
def grabkeys_dlg_release(self, src_ignore, ev, defs):
|
||||
label = defs['label']
|
||||
defs['keysyms'].remove(ev.keyval)
|
||||
label.set_text( self.grabkeys_get_string(defs['keysyms']) )
|
||||
|
||||
def change_grab_keys(self, src):
|
||||
def change_grab_keys(self, src_ignore):
|
||||
dialog = gtk.Dialog ( _("Configure grab key combination"),
|
||||
None,
|
||||
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
@ -272,7 +272,7 @@ class vmmPreferences(vmmGObjectUI):
|
||||
def change_confirm_interface(self, src):
|
||||
self.config.set_confirm_interface(src.get_active())
|
||||
|
||||
def show_help(self, src):
|
||||
def show_help(self, src_ignore):
|
||||
# From the Preferences window, show the help document from
|
||||
# the Preferences page
|
||||
self.emit("action-show-help", "virt-manager-preferences-window")
|
||||
|
@ -71,10 +71,10 @@ class vmmSerialConsole(gtk.HBox):
|
||||
def handle_realize(self, ignore=None):
|
||||
self.opentty()
|
||||
|
||||
def handle_unrealize(self, src=None, ignore=None):
|
||||
def handle_unrealize(self, src_ignore=None, ignore=None):
|
||||
self.closetty()
|
||||
|
||||
def vm_status_changed(self, src, oldstatus_ignore, status):
|
||||
def vm_status_changed(self, src_ignore, oldstatus_ignore, status):
|
||||
if status in [ libvirt.VIR_DOMAIN_RUNNING ]:
|
||||
self.opentty()
|
||||
else:
|
||||
@ -130,11 +130,11 @@ class vmmSerialConsole(gtk.HBox):
|
||||
self.ptysrc = None
|
||||
self.ptytermios = None
|
||||
|
||||
def send_data(self, src, text, length):
|
||||
def send_data(self, src_ignore, text, length_ignore):
|
||||
if self.ptyio != None:
|
||||
os.write(self.ptyio, text)
|
||||
|
||||
def display_data(self, src, cond):
|
||||
def display_data(self, src_ignore, cond):
|
||||
if cond == gobject.IO_IN:
|
||||
data = os.read(self.ptyio, 1024)
|
||||
self.terminal.feed(data, len(data))
|
||||
|
@ -209,7 +209,7 @@ class vmmStorageBrowser(vmmGObjectUI):
|
||||
return pool.get_volume(curruuid)
|
||||
return None
|
||||
|
||||
def refresh_storage_pool(self, src, uri, uuid):
|
||||
def refresh_storage_pool(self, src_ignore, uri_ignore, uuid):
|
||||
pool_list = self.window.get_widget("pool-list")
|
||||
virtManager.host.refresh_pool_in_list(pool_list, self.conn, uuid)
|
||||
curpool = self.current_pool()
|
||||
@ -220,14 +220,14 @@ class vmmStorageBrowser(vmmGObjectUI):
|
||||
# update vol list
|
||||
self.pool_selected(self.window.get_widget("pool-list").get_selection())
|
||||
|
||||
def repopulate_storage_pools(self, src, uri, uuid):
|
||||
def repopulate_storage_pools(self, src_ignore, uri_ignore, uuid_ignore):
|
||||
pool_list = self.window.get_widget("pool-list")
|
||||
virtManager.host.populate_storage_pools(pool_list, self.conn)
|
||||
|
||||
|
||||
# Listeners
|
||||
|
||||
def pool_selected(self, src):
|
||||
def pool_selected(self, src_ignore):
|
||||
pool = self.current_pool()
|
||||
self.window.get_widget("new-volume").set_sensitive(bool(pool))
|
||||
if pool:
|
||||
@ -245,7 +245,7 @@ class vmmStorageBrowser(vmmGObjectUI):
|
||||
cp.refresh()
|
||||
self.refresh_storage_pool(None, None, cp.get_uuid())
|
||||
|
||||
def new_volume(self, src):
|
||||
def new_volume(self, src_ignore):
|
||||
pool = self.current_pool()
|
||||
if pool is None:
|
||||
return
|
||||
@ -263,7 +263,7 @@ class vmmStorageBrowser(vmmGObjectUI):
|
||||
self.show_err(_("Error launching volume wizard: %s") % str(e),
|
||||
"".join(traceback.format_exc()))
|
||||
|
||||
def browse_local(self, src):
|
||||
def browse_local(self, src_ignore):
|
||||
filename = util.browse_local(parent=self.topwin, config=self.config,
|
||||
conn=self.conn, **self.local_args)
|
||||
if filename:
|
||||
|
@ -264,10 +264,10 @@ class vmmSystray(gobject.GObject):
|
||||
|
||||
# Listeners
|
||||
|
||||
def systray_activate(self, widget):
|
||||
def systray_activate(self, widget_ignore):
|
||||
self.emit("action-toggle-manager")
|
||||
|
||||
def systray_popup(self, widget, button, event_time):
|
||||
def systray_popup(self, widget_ignore, button, event_time):
|
||||
if button != 3:
|
||||
return
|
||||
|
||||
@ -290,7 +290,7 @@ class vmmSystray(gobject.GObject):
|
||||
self.systray_menu.insert(self.conn_menuitems[uri], 0)
|
||||
|
||||
|
||||
def conn_added(self, engine, conn):
|
||||
def conn_added(self, engine_ignore, conn):
|
||||
conn.connect("vm-added", self.vm_added)
|
||||
conn.connect("vm-removed", self.vm_removed)
|
||||
conn.connect("state-changed", self.conn_state_changed)
|
||||
@ -312,7 +312,7 @@ class vmmSystray(gobject.GObject):
|
||||
self.conn_state_changed(conn)
|
||||
self.populate_vm_list(conn)
|
||||
|
||||
def conn_removed(self, engine, conn):
|
||||
def conn_removed(self, engine_ignore, conn):
|
||||
if not self.conn_menuitems.has_key(conn.get_uri()):
|
||||
return
|
||||
|
||||
@ -382,7 +382,7 @@ class vmmSystray(gobject.GObject):
|
||||
self.vm_state_changed(vm)
|
||||
menu_item.show()
|
||||
|
||||
def vm_removed(self, conn, uri, uuid):
|
||||
def vm_removed(self, conn_ignore, uri, uuid):
|
||||
vm_mappings = self.conn_vm_menuitems[uri]
|
||||
if not vm_mappings:
|
||||
return
|
||||
|
@ -144,6 +144,7 @@ def build_video_combo(vm, video_dev, no_default=False):
|
||||
video_dev.set_active(0)
|
||||
|
||||
def build_sound_combo(vm, combo, no_default=False):
|
||||
ignore = vm
|
||||
dev_model = gtk.ListStore(str)
|
||||
combo.set_model(dev_model)
|
||||
text = gtk.CellRendererText()
|
||||
@ -164,6 +165,7 @@ def build_sound_combo(vm, combo, no_default=False):
|
||||
combo.set_active(0)
|
||||
|
||||
def build_watchdogmodel_combo(vm, combo, no_default=False):
|
||||
ignore = vm
|
||||
dev_model = gtk.ListStore(str)
|
||||
combo.set_model(dev_model)
|
||||
text = gtk.CellRendererText()
|
||||
@ -179,6 +181,7 @@ def build_watchdogmodel_combo(vm, combo, no_default=False):
|
||||
combo.set_active(0)
|
||||
|
||||
def build_watchdogaction_combo(vm, combo, no_default=False):
|
||||
ignore = vm
|
||||
dev_model = gtk.ListStore(str, str)
|
||||
combo.set_model(dev_model)
|
||||
text = gtk.CellRendererText()
|
||||
@ -221,6 +224,7 @@ def populate_netmodel_combo(vm, combo):
|
||||
model.append([m, m])
|
||||
|
||||
def build_cache_combo(vm, combo, no_default=False):
|
||||
ignore = vm
|
||||
dev_model = gtk.ListStore(str, str)
|
||||
combo.set_model(dev_model)
|
||||
text = gtk.CellRendererText()
|
||||
|
@ -364,7 +364,7 @@ def uuidstr(rawuuid):
|
||||
return "".join(uuid)
|
||||
|
||||
def bind_escape_key_close(vmmobj):
|
||||
def close_on_escape(src, event):
|
||||
def close_on_escape(src_ignore, event):
|
||||
if gtk.gdk.keyval_name(event.keyval) == "Escape":
|
||||
vmmobj.close()
|
||||
|
||||
|
@ -65,7 +65,6 @@ addmsg "W0704" # W0704: Exception doesn't do anything
|
||||
|
||||
# Potentially useful messages, disabled for now
|
||||
addmsg "W0511" # W0511: FIXME and XXX: messages
|
||||
addmsg "W0613" # W0613: Unused arguments
|
||||
addmsg_support "W6501" # W6501: Using string formatters in logging message
|
||||
# (see help message for info)
|
||||
|
||||
@ -83,7 +82,7 @@ AWK=awk
|
||||
pylint --ignore=$IGNOREFILES $FILES \
|
||||
--reports=$SHOW_REPORT \
|
||||
--output-format=colorized \
|
||||
--dummy-variables-rgx="dummy|ignore*" \
|
||||
--dummy-variables-rgx="dummy|ignore.*|.*_ignore" \
|
||||
--disable=${DMSG}\
|
||||
--disable=${DCHECKERS} 2>&1 | \
|
||||
egrep -ve "$NO_PYL_CONFIG" \
|
||||
|
Loading…
Reference in New Issue
Block a user