19 #
20 # CDDL HEADER END
21 #
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25
26 MIN_IND_ELEMENTS_BOUNCE = 5 # During indexing the progress will be progressive if
27 # the number of indexing elements is greater then this,
28 # otherwise it will bounce
29
30 import errno
31 import os
32 import sys
33 import time
34 import pango
35 import datetime
36 import traceback
37 import string
38 from threading import Thread
39 from urllib2 import URLError
40 try:
41 import gobject
42 import gtk
43 import gtk.glade
44 import pygtk
45 pygtk.require("2.0")
46 except ImportError:
47 sys.exit(1)
48 nobe = False
49 try:
50 import libbe as be
51 except ImportError:
52 nobe = True
53 import pkg.client.progress as progress
54 import pkg.misc
55 from pkg.client.retrieve import ManifestRetrievalError
56 from pkg.client.retrieve import DatastreamRetrievalError
57 from pkg.client.filelist import FileListRetrievalError
58 import pkg.client.api_errors as api_errors
59 from pkg.misc import TransferTimedOutException, TransportException
60 import pkg.gui.beadmin as beadm
61 import pkg.gui.misc as gui_misc
62 import pkg.gui.enumerations as enumerations
63
64 ERROR_FORMAT = "<span color = \"red\">%s</span>"
65
66
67 class InstallUpdate(progress.ProgressTracker):
68 def __init__(self, list_of_packages, parent, api_o,
69 ips_update = False, action = -1, be_name = None,
70 parent_name = "", pkg_list = None, main_window = None,
71 icon_confirm_dialog = None, title = None, web_install = False):
72 if action == -1:
73 return
74 progress.ProgressTracker.__init__(self)
75 self.web_install = web_install
76 self.web_updates_list = None
77 api_o.progresstracker = self
78 self.api_o = api_o
79 self.parent = parent
417 " repository\ncertificate.")
418 self.__g_error_stage(msg)
419 return
420 except api_errors.PlanCreationException, e:
421 self.__g_error_stage(str(e))
422 return
423 except api_errors.InventoryException, e:
424 msg = _("Inventory exception:\n")
425 if e.illegal:
426 for i in e.illegal:
427 msg += "\tpkg:\t" + i +"\n"
428 self.__g_error_stage(msg)
429 return
430 except api_errors.CatalogRefreshException, e:
431 msg = _("Please check the network "
432 "connection.\nIs the repository accessible?")
433 if e.message and len(e.message) > 0:
434 msg = e.message
435 self.__g_error_stage(msg)
436 return
437 except (api_errors.NetworkUnavailableException,
438 TransferTimedOutException, TransportException, URLError,
439 ManifestRetrievalError, DatastreamRetrievalError,
440 FileListRetrievalError), ex:
441 msg = _("Please check the network "
442 "connection.\nIs the repository accessible?\n\n"
443 "%s") % str(ex)
444 self.__g_error_stage(msg)
445 return
446 except api_errors.InvalidDepotResponseException, e:
447 msg = _("\nUnable to contact a valid package depot. "
448 "Please check your network\nsettings and "
449 "attempt to contact the server using a web "
450 "browser.\n\n%s") % str(e)
451 self.__g_error_stage(msg)
452 return
453 except api_errors.IpkgOutOfDateException:
454 msg = _("pkg(5) appears to be out of "
455 "date and should be\nupdated before running "
456 "Update All.\nPlease update SUNWipkg package")
457 self.__g_error_stage(msg)
458 return
459 except api_errors.NonLeafPackageException, nlpe:
460 msg = _("Cannot remove:\n\t%s\n"
|
19 #
20 # CDDL HEADER END
21 #
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25
26 MIN_IND_ELEMENTS_BOUNCE = 5 # During indexing the progress will be progressive if
27 # the number of indexing elements is greater then this,
28 # otherwise it will bounce
29
30 import errno
31 import os
32 import sys
33 import time
34 import pango
35 import datetime
36 import traceback
37 import string
38 from threading import Thread
39 try:
40 import gobject
41 import gtk
42 import gtk.glade
43 import pygtk
44 pygtk.require("2.0")
45 except ImportError:
46 sys.exit(1)
47 nobe = False
48 try:
49 import libbe as be
50 except ImportError:
51 nobe = True
52 import pkg.client.progress as progress
53 import pkg.misc
54 import pkg.client.api_errors as api_errors
55 import pkg.gui.beadmin as beadm
56 import pkg.gui.misc as gui_misc
57 import pkg.gui.enumerations as enumerations
58
59 ERROR_FORMAT = "<span color = \"red\">%s</span>"
60
61
62 class InstallUpdate(progress.ProgressTracker):
63 def __init__(self, list_of_packages, parent, api_o,
64 ips_update = False, action = -1, be_name = None,
65 parent_name = "", pkg_list = None, main_window = None,
66 icon_confirm_dialog = None, title = None, web_install = False):
67 if action == -1:
68 return
69 progress.ProgressTracker.__init__(self)
70 self.web_install = web_install
71 self.web_updates_list = None
72 api_o.progresstracker = self
73 self.api_o = api_o
74 self.parent = parent
412 " repository\ncertificate.")
413 self.__g_error_stage(msg)
414 return
415 except api_errors.PlanCreationException, e:
416 self.__g_error_stage(str(e))
417 return
418 except api_errors.InventoryException, e:
419 msg = _("Inventory exception:\n")
420 if e.illegal:
421 for i in e.illegal:
422 msg += "\tpkg:\t" + i +"\n"
423 self.__g_error_stage(msg)
424 return
425 except api_errors.CatalogRefreshException, e:
426 msg = _("Please check the network "
427 "connection.\nIs the repository accessible?")
428 if e.message and len(e.message) > 0:
429 msg = e.message
430 self.__g_error_stage(msg)
431 return
432 except api_errors.TransportError, ex:
433 msg = _("Please check the network "
434 "connection.\nIs the repository accessible?\n\n"
435 "%s") % str(ex)
436 self.__g_error_stage(msg)
437 return
438 except api_errors.InvalidDepotResponseException, e:
439 msg = _("\nUnable to contact a valid package depot. "
440 "Please check your network\nsettings and "
441 "attempt to contact the server using a web "
442 "browser.\n\n%s") % str(e)
443 self.__g_error_stage(msg)
444 return
445 except api_errors.IpkgOutOfDateException:
446 msg = _("pkg(5) appears to be out of "
447 "date and should be\nupdated before running "
448 "Update All.\nPlease update SUNWipkg package")
449 self.__g_error_stage(msg)
450 return
451 except api_errors.NonLeafPackageException, nlpe:
452 msg = _("Cannot remove:\n\t%s\n"
|