]>
git.ipfire.org Git - people/stevee/pakfire.git/blob - scripts/pakfire-multicall.py
7 log
= logging
.getLogger("pakfire")
10 from pakfire
.cli
import *
11 from pakfire
.i18n
import _
13 except ImportError, e
:
14 # Catch ImportError and show a more user-friendly message about what
17 # Try to load at least the i18n support, but when this fails as well we can
18 # go with an English error message.
20 from pakfire
.i18n
import _
24 # XXX Maybe we can make a more beautiful message here?!
25 print _("There has been an error when trying to import one or more of the"
26 " modules, that are required to run Pakfire.")
27 print _("Please check your installation of Pakfire.")
29 print _("The error that lead to this:")
38 "pakfire-builder" : CliBuilder
,
39 "pakfire-server" : CliServer
,
40 "builder" : CliBuilderIntern
,
43 # Get the basename of the program
44 basename
= os
.path
.basename(sys
.argv
[0])
46 # Check if the program was called with a weird basename.
47 # If so, we exit immediately.
48 if not basename2cls
.has_key(basename
):
51 # Return code for the shell.
55 # Creating command line interface
56 cli
= basename2cls
[basename
]()
60 except KeyboardInterrupt:
61 log
.critical("Recieved keyboard interupt (Ctrl-C). Exiting.")
64 # Catch all errors and show a user-friendly error message.
67 log
.critical(_("An error has occured when running Pakfire."))
70 log
.error(_("Error message:"))
71 log
.error(" %s: %s" % (e
.__class
__.__name
__, e
.message
))
74 log
.error(_("Further description:"))