From e9c45f265ac2bd05135eb14a66daf4bcda20ade7 Mon Sep 17 00:00:00 2001 From: necoro <> Date: Fri, 29 Sep 2006 18:40:13 +0000 Subject: Build in a general helper-file including debugging output --- geneticone/__init__.py | 3 ++- geneticone/exceptions.py | 22 ++++++++++++++++++++++ geneticone/portage_helper.py | 19 ------------------- 3 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 geneticone/exceptions.py diff --git a/geneticone/__init__.py b/geneticone/__init__.py index f07bc68..2478ddf 100644 --- a/geneticone/__init__.py +++ b/geneticone/__init__.py @@ -26,6 +26,7 @@ porttree = gentoolkit.porttree vartree = gentoolkit.vartree # import our packages -from debug import * +from helper import * +from exceptions import * from portage_helper import * from package import * diff --git a/geneticone/exceptions.py b/geneticone/exceptions.py new file mode 100644 index 0000000..5780de6 --- /dev/null +++ b/geneticone/exceptions.py @@ -0,0 +1,22 @@ +# +# File: geneticone/exceptions.py +# This file is part of the Genetic/One-Project, a graphical portage-frontend. +# +# Copyright (C) 2006 Necoro d.M. +# This is free software. You may redistribute copies of it under the terms of +# the GNU General Public License version 2. +# There is NO WARRANTY, to the extent permitted by law. +# +# Written by Necoro d.M. + +class BlockedException (Exception): + """An exception marking, that some package is blocking another one.""" + pass + +class PackageNotFoundException (Exception): + """An exception marking that a package could not be found.""" + pass + +class DependencyCalcError (Exception): + """An error occured during dependency calculation.""" + pass diff --git a/geneticone/portage_helper.py b/geneticone/portage_helper.py index 2d62dcf..aab9426 100644 --- a/geneticone/portage_helper.py +++ b/geneticone/portage_helper.py @@ -19,18 +19,6 @@ import gentoolkit import portage from portage_util import unique_array -class BlockedException (Exception): - """An exception marking, that some package is blocking another one.""" - pass - -class PackageNotFoundException (Exception): - """An exception marking that a package could not be found.""" - pass - -class DependencyCalcError (Exception): - """An error occured during dependency calculation.""" - pass - def find_lambda (name): """Returns the function needed by all the find_all_*-functions. Returns None if no name is given. @param name: name to build the function of @@ -125,13 +113,6 @@ def sort_package_list(pkglist): """Sorts a package list in the same manner portage does.""" return gentoolkit.sort_package_list(pkglist) -def am_i_root (): - """Returns True if the current user is root, False otherwise.""" - if os.getuid() == 0: - return True - else: - return False - use_descs = {} local_use_descs = {} def get_use_desc (flag, package = None): -- cgit v1.2.3-70-g09d2