From 8c066e79b03ad4e20a9f7c4ae36a9e247b79a8eb Mon Sep 17 00:00:00 2001 From: necoro <> Date: Mon, 27 Aug 2007 07:30:38 +0000 Subject: Change to absolute_imports; Warning: definitly broken --- portato/backend/flags.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'portato/backend/flags.py') diff --git a/portato/backend/flags.py b/portato/backend/flags.py index 99ff56f..1e1325e 100644 --- a/portato/backend/flags.py +++ b/portato/backend/flags.py @@ -10,14 +10,15 @@ # # Written by René 'Necoro' Neumann +from __future__ import absolute_import + import os import os.path from subprocess import Popen, PIPE # needed for grep from gettext import lgettext as _ -from portato.helper import * -from portato.backend import system -import package +from . import system, _Package +from ..helper import debug, error, unique_array CONFIG = { "usefile" : "portato", @@ -93,7 +94,7 @@ def grep (pkg, path): @returns: occurences of pkg in the format: "file:line-no:complete_line_found" @rtype: string""" - if not isinstance(pkg, package.Package): + if not isinstance(pkg, _Package): pkg = system.new_package(pkg) # assume it is a cpv or a gentoolkit.Package if os.path.exists(path): @@ -201,7 +202,7 @@ def set_use_flag (pkg, flag): global useFlags, newUseFlags - if not isinstance(pkg, package.Package): + if not isinstance(pkg, _Package): pkg = system.new_package(pkg) # assume cpv or gentoolkit.Package cpv = pkg.get_cpv() @@ -265,7 +266,7 @@ def remove_new_use_flags (cpv): @param cpv: the package for which to remove the flags @type cpv: string (cpv) or L{backend.Package}-object""" - if isinstance(cpv, package.Package): + if isinstance(cpv, _Package): cpv = cpv.get_cpv() try: @@ -281,7 +282,7 @@ def get_new_use_flags (cpv): @returns: list of flags @rtype: string[]""" - if isinstance(cpv, package.Package): + if isinstance(cpv, _Package): cpv = cpv.get_cpv() list2return = [] @@ -398,7 +399,7 @@ def set_masked (pkg, masked = True): global new_masked, newunmasked - if not isinstance(pkg, package.Package): + if not isinstance(pkg, _Package): pkg = system.new_package(pkg) cpv = pkg.get_cpv() @@ -457,7 +458,7 @@ def set_masked (pkg, masked = True): debug("new_(un)masked: %s",str(link_neq)) def remove_new_masked (cpv): - if isinstance(cpv, package.Package): + if isinstance(cpv, _Package): cpv = cpv.get_cpv() try: @@ -471,7 +472,7 @@ def remove_new_masked (cpv): pass def new_masking_status (cpv): - if isinstance(cpv, package.Package): + if isinstance(cpv, _Package): cpv = cpv.get_cpv() def get(list): @@ -499,7 +500,7 @@ def new_masking_status (cpv): def is_locally_masked (pkg, changes = True): - if not isinstance(pkg, package.Package): + if not isinstance(pkg, _Package): pkg = system.new_package(pkg) # assume it is a cpv or a gentoolkit.Package if changes: @@ -594,7 +595,7 @@ newTesting = {} arch = "" def remove_new_testing (cpv): - if isinstance(cpv, package.Package): + if isinstance(cpv, _Package): cpv = cpv.get_cpv() try: @@ -603,7 +604,7 @@ def remove_new_testing (cpv): pass def new_testing_status (cpv): - if isinstance(cpv, package.Package): + if isinstance(cpv, _Package): cpv = cpv.get_cpv() if cpv in newTesting: @@ -621,7 +622,7 @@ def set_testing (pkg, enable): @type enable: boolean""" global arch, newTesting - if not isinstance(pkg, package.Package): + if not isinstance(pkg, _Package): pkg = system.new_package(pkg) arch = pkg.get_global_settings("ARCH") -- cgit v1.2.3-54-g00ecf