]>
git.ipfire.org Git - people/stevee/pakfire.git/blob - src/scripts/pakfire
2 ###############################################################################
4 # Pakfire - The IPFire package management system #
5 # Copyright (C) 2017 Pakfire development team #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
25 # Catch ImportError and show a more user-friendly message about what went wrong
29 except ImportError as e
:
30 # Try to load at least the i18n support, but when this fails as well we can
31 # go with an English error message.
33 from pakfire
.i18n
import _
37 print(_("There has been an error when trying to import one or more of the"
38 " modules, that are required to run Pakfire."))
39 print(_("Please check your installation of Pakfire."))
41 print(_("The error that lead to this:"))
49 "pakfire" : pakfire
.cli
.Cli
,
50 "pakfire-builder" : pakfire
.cli
.CliBuilder
,
51 "pakfire-client" : pakfire
.cli
.CliClient
,
52 "pakfire-daemon" : pakfire
.cli
.CliDaemon
,
53 "pakfire-key" : pakfire
.cli
.CliKey
,
54 "pakfire-server" : pakfire
.cli
.CliServer
,
55 "builder" : pakfire
.cli
.CliBuilderIntern
,
58 # Get the basename of the program
59 basename
= os
.path
.basename(sys
.argv
[0])
61 # Check if the program was called with a weird basename.
62 # If so, we exit immediately.
63 if basename
not in basename2cls
:
66 cli
= basename2cls
[basename
]()