relative imports fix

master
idziubenko 3 years ago
parent 0356ff2f72
commit 644056b588

@ -18,16 +18,16 @@ from contextlib import contextmanager
import sys
import os
import errno
from calculate.lib.cl_xml import xpath
from .cl_xml import xpath, firstChild
from copy import deepcopy
import time
import fcntl
from .cl_xml import firstChild
from copy import deepcopy
from .utils.common import _error
from .cl_template import FormatFactory, TemplatesError
from calculate.lib.cl_lang import setLocalTranslate
from .cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -23,7 +23,7 @@ from collections import defaultdict
from ldif import LDIFParser, LDIFWriter
import io
from calculate.lib.cl_lang import setLocalTranslate
from .cl_lang import setLocalTranslate
from functools import reduce
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -19,10 +19,10 @@ import os
import stat
import re
import importlib
from calculate.lib.utils.portage import getInstalledAtom, RepositoryPath, \
from .utils.portage import getInstalledAtom, RepositoryPath, \
searchProfile, RepositorySubstituting
from calculate.lib.cl_xml import xmlShare
from calculate.lib.utils.system import SystemPath, FUser, emerge_running
from .cl_xml import xmlShare
from .utils.system import SystemPath, FUser, emerge_running
from functools import wraps
import random
import string
@ -51,10 +51,10 @@ from .utils.files import (getModeFile, listDirectory, removeDir, typeFile,
from .utils.mount import Mounts
from .utils.tools import iterate_list, has_any, Locker
from .datavars import DataVarsError, VariableError, CriticalError, SimpleDataVars
from calculate.lib.configparser import (ConfigParser, NoSectionError,
from .configparser import (ConfigParser, NoSectionError,
ParsingError)
from calculate.lib.cl_lang import setLocalTranslate, RegexpLocalization
from .cl_lang import setLocalTranslate, RegexpLocalization
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])
@ -104,7 +104,7 @@ class DataVarsConfig(SimpleDataVars):
Получить профиль и emerge config из chroot системы
"""
def __init__(self, chroot_path='/'):
from calculate.lib.variables import env
from .variables import env
SimpleDataVars.__init__(
self,
env.VariableClMakeProfile(systemRoot=chroot_path),

@ -582,7 +582,7 @@ class xmlDoc():
def insertBeforeSepAreas(self, xmlArea):
"""Добавляет разделитель областей перед каждой областью"""
if not self.sepAreas:
if self.sepAreas is None:
return False
areaNodes = xpath.Evaluate('descendant::area', xmlArea)
for areaNode in areaNodes:

@ -21,7 +21,7 @@ MAX_INTERPOLATION_DEPTH = 10
UTF8 = 'utf-8'
import os
from contextlib import contextmanager
from calculate.lib.utils.tools import LockError, Locker
from .utils.tools import LockError, Locker
#compat
NoSectionError = configparser.NoSectionError

@ -16,7 +16,7 @@
from .utils.text import convertStrListDict
from calculate.lib.configparser import ConfigParser
from .configparser import ConfigParser
from collections import defaultdict

@ -19,7 +19,7 @@
import re
import sys
import importlib
from calculate.lib.utils.tools import drop_slash
from .utils.tools import drop_slash
from .utils.text import convertStrListDict, _u, _u8, formatListOr
from .utils.files import pathJoin
from .utils.portage import searchProfile, RepositorySubstituting, RepositoryPath
@ -35,9 +35,9 @@ from string import Formatter
from contextlib import contextmanager
# from types import StringTypes, GeneratorType
from types import GeneratorType
from calculate.lib.configparser import ConfigParser, ParsingError
from .configparser import ConfigParser, ParsingError
from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate
from .cl_lang import setLocalTranslate, getLazyLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])
@ -1868,10 +1868,7 @@ class DataVars(SimpleDataVars):
"""
def compare_choice(part_s, *options):
# lower_unicode = lambda x: _u(x).lower()
# part_s = lower_unicode(part_s)
part_s = part_s.lower()
# options = [lower_unicode(x) for x in options]
options = [x.lower() for x in options]
return any(x == part_s for x in options)

@ -32,7 +32,7 @@ from .cl_print import color_print
from . import cl_overriding
from calculate.contrib.passlib.hash import sha256_crypt, grub_pbkdf2_sha512
from calculate.lib.cl_lang import setLocalTranslate
from .cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -14,9 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from calculate.lib.cl_xml import xpath, xmlDoc
from calculate.lib.cl_template import blocText
from calculate.lib.format.bind import bind
from ..cl_xml import xpath, xmlDoc
from ..cl_template import blocText
from .bind import bind
class apache(bind):

@ -17,11 +17,11 @@
import sys
import os
import re
from calculate.lib.cl_template import TemplateFormat
from ..cl_template import TemplateFormat
import hashlib
from calculate.lib.cl_lang import setLocalTranslate
from calculate.lib.utils.files import (getProgPath, pathJoin, process, STDOUT,
from ..cl_lang import setLocalTranslate
from ..utils.files import (getProgPath, pathJoin, process, STDOUT,
readFile, writeFile, listDirectory)
_ = lambda x: x

@ -16,8 +16,8 @@
import re
from .generic import objShare
from calculate.lib.cl_template import blocText
from calculate.lib.cl_xml import xmlDoc
from ..cl_template import blocText
from ..cl_xml import xmlDoc
class bind(objShare):

@ -17,14 +17,14 @@
import sys
import re
import glob
from calculate.lib.cl_template import TemplateFormat
from ..cl_template import TemplateFormat
from calculate.lib.cl_lang import setLocalTranslate
from calculate.lib.utils.common import getTupleVersion
from calculate.lib.utils.content import PkgContents
from calculate.lib.utils.portage import getInstalledAtom
from calculate.lib.utils.files import pathJoin
from calculate.lib.utils.tools import classificate
from ..cl_lang import setLocalTranslate
from ..utils.common import getTupleVersion
from ..utils.content import PkgContents
from ..utils.portage import getInstalledAtom
from ..utils.files import pathJoin
from ..utils.tools import classificate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -15,11 +15,11 @@
# limitations under the License.
import sys
from calculate.lib.cl_template import TemplateFormat
from calculate.lib.utils.files import process, STDOUT, getProgPath
from ..cl_template import TemplateFormat
from ..utils.files import process, STDOUT, getProgPath
from os import path
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -16,10 +16,10 @@
import sys
import re
from calculate.lib.cl_template import TemplateFormat
from calculate.lib.utils.files import process
from ..cl_template import TemplateFormat
from ..utils.files import process
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -15,8 +15,8 @@
# limitations under the License.
import re
from calculate.lib.cl_xml import xpath
from calculate.lib.format.bind import bind
from ..cl_xml import xpath
from .bind import bind
class dovecot(bind):

@ -15,7 +15,7 @@
# limitations under the License.
import re
from calculate.lib.cl_template import TemplateFormat
from ..cl_template import TemplateFormat
class objShare(TemplateFormat):

@ -15,11 +15,11 @@
# limitations under the License.
import sys
from calculate.lib.cl_template import TemplateFormat
from calculate.lib.utils.text import _u
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_template import TemplateFormat
from ..utils.text import _u
from ..cl_lang import setLocalTranslate
from collections import OrderedDict
from calculate.lib.utils.tools import json_module
from ..utils.tools import json_module
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -15,8 +15,8 @@
# limitations under the License.
import re
from calculate.lib.cl_xml import xmlDoc
from calculate.lib.format.samba import samba
from ..cl_xml import xmlDoc
from .samba import samba
class kde(samba):

@ -15,8 +15,8 @@
# limitations under the License.
import sys
from calculate.lib.cl_template import TemplateFormat
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_template import TemplateFormat
from ..cl_lang import setLocalTranslate
from collections import OrderedDict
_ = lambda x: x

@ -15,9 +15,9 @@
# limitations under the License.
import re
from calculate.lib.cl_template import blocText
from calculate.lib.cl_xml import xmlDoc
from calculate.lib.format.samba import samba
from ..cl_template import blocText
from ..cl_xml import xmlDoc
from .samba import samba
class ldap(samba):

@ -15,7 +15,7 @@
# limitations under the License.
import re
from calculate.lib.format.procmail import procmail
from .procmail import procmail
class openrc(procmail):

@ -18,9 +18,9 @@ import sys
import re
# import xml.dom.minidom
from lxml import etree
from calculate.lib.cl_template import TemplateFormat
from calculate.lib.cl_xml import firstChild
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_template import TemplateFormat
from ..cl_xml import firstChild
from ..cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])
@ -38,7 +38,7 @@ class patch(TemplateFormat):
def prepare(self):
# Создаем XML документ
self.doc = self.textToXML()
if self.doc:
if self.doc is not None:
self.rootNode = self.doc.getroottree().getroot()
self.reFlags = 0

@ -16,10 +16,10 @@
import re
import copy
from calculate.lib.cl_xml import xpath, xmlDoc, firstChild, insertBefore
from ..cl_xml import xpath, xmlDoc, firstChild, insertBefore
from copy import deepcopy
from calculate.lib.cl_template import blocText
from calculate.lib.format.samba import samba
from ..cl_template import blocText
from .samba import samba
class PlasmaArea():
def __init__(self):

@ -15,8 +15,8 @@
# limitations under the License.
import re
from calculate.lib.cl_xml import xmlDoc
from calculate.lib.format.apache import apache
from ..cl_xml import xmlDoc
from .apache import apache
class postfix(apache):

@ -15,7 +15,7 @@
# limitations under the License.
import re
from calculate.lib.cl_xml import xpath, xmlDoc, insertBefore
from ..cl_xml import xpath, xmlDoc, insertBefore
from .generic import objShare
class procmail(objShare):

@ -15,10 +15,10 @@
# limitations under the License.
import re
from calculate.lib.cl_xml import xpath
from ..cl_xml import xpath
from .generic import objShare
from calculate.lib.cl_template import blocText
from calculate.lib.cl_xml import xmlDoc, insertBefore
from ..cl_template import blocText
from ..cl_xml import xmlDoc, insertBefore
class samba(objShare):

@ -15,9 +15,9 @@
# limitations under the License.
import sys
from calculate.lib.cl_template import TemplateFormat
from ..cl_template import TemplateFormat
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -15,7 +15,7 @@
# limitations under the License.
import re
from calculate.lib.format.procmail import procmail
from .procmail import procmail
class squid(procmail):

@ -15,9 +15,9 @@
# limitations under the License.
import sys
from calculate.lib.cl_template import TemplateFormat
from calculate.lib.utils.text import _u
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_template import TemplateFormat
from ..utils.text import _u
from ..cl_lang import setLocalTranslate
from os import path
import re

@ -17,11 +17,11 @@
import sys
import time
import re
from calculate.lib.cl_xml import xpath
from ..cl_xml import xpath
# import xml.dom.minidom
from lxml import etree
from calculate.lib.format.xml_xfce import xml_xfce
from calculate.lib.cl_lang import setLocalTranslate
from .xml_xfce import xml_xfce
from ..cl_lang import setLocalTranslate
from collections.abc import Iterable
from copy import deepcopy

@ -15,9 +15,9 @@
# limitations under the License.
import sys
from calculate.lib.cl_xml import xpath
from calculate.lib.format.xml_gconf import xml_gconf
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_xml import xpath
from .xml_gconf import xml_gconf
from ..cl_lang import setLocalTranslate
from collections.abc import Iterable
from copy import deepcopy

@ -15,11 +15,11 @@
# limitations under the License.
import sys
from calculate.lib.cl_xml import xpath
from ..cl_xml import xpath
# import xml.dom.minidom
from lxml import etree
from calculate.lib.cl_template import TemplateFormat
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_template import TemplateFormat
from ..cl_lang import setLocalTranslate
from collections.abc import Iterable
from copy import deepcopy
_ = lambda x: x

@ -15,13 +15,13 @@
# limitations under the License.
import sys
from calculate.lib.cl_xml import xpath
from ..cl_xml import xpath
# import xml.dom.minidom
from lxml import etree
from calculate.lib.format.xml_xfce import xml_xfce
from .xml_xfce import xml_xfce
from collections.abc import Iterable
from copy import deepcopy
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -18,7 +18,7 @@ from collections import namedtuple
import sys
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -20,9 +20,9 @@ import re
import time
import os
from os import path
from calculate.lib.configparser import ConfigParserCaseSens, Error as CPError
from calculate.lib.utils.tools import SingletonParam, Cachable
from calculate.lib.utils.gpg import GPGError
from ..configparser import ConfigParserCaseSens, Error as CPError
from .tools import SingletonParam, Cachable
from .gpg import GPGError
from .files import writeFile, xz
from collections import OrderedDict
from collections.abc import MutableMapping
@ -32,7 +32,7 @@ import io
import threading
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])
@ -117,7 +117,7 @@ class BinhostsBase(Cachable):
if fn:
cp = ConfigParserCaseSens()
try:
cp.read_string(unicode(data))
cp.read_string(str(data))
base_dn = path.dirname(fn)
for pkg_file in cp['timestamp']:
if not self.check_package_timestamp(

@ -17,7 +17,7 @@
from .output import BaseOutput
from .palette import (TextState, BaseColorMapping, ConsoleCodesInfo,
LightColorMapping, ConsoleColor256, XmlFormat)
from calculate.lib.utils.tools import SavableIterator, ignore
from ..tools import SavableIterator, ignore
from html.parser import HTMLParser
# from HTMLParser import HTMLParser
import re

@ -21,7 +21,7 @@ import sys
import struct
import fcntl
import termios
from calculate.lib.utils.tools import Singleton, ignore
from ..tools import Singleton, ignore
class Terminal(metaclass=Singleton):

@ -17,7 +17,7 @@
import re
from itertools import chain
from math import pow
from calculate.lib.utils.text import MultiReplace
from ..text import MultiReplace
class ConsoleCodesInfo():

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from .output import BaseOutput, BasePositionOutput
from calculate.lib.utils.text import _uu8
from ..text import _uu8
from io import IOBase
class Print():

@ -20,8 +20,8 @@ import os
import re
import math
from os import path
from calculate.lib.utils.dracut import Dracut
from calculate.lib.utils.system import SystemPath
from .dracut import Dracut
from .system import SystemPath
import sys
import getpass
import string
@ -29,7 +29,7 @@ import glob
import pwd
import itertools
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])
@ -441,7 +441,7 @@ def dict_by_columns(i, sep, key, value):
return dict(((x[key], x[value]) for x in (y.split(sep) for y in i) if len(x) >= max_val))
from calculate.lib.utils.files import readLinesFile
from ..utils.files import readLinesFile
def getUserGroups(userName, prefix="/"):
@ -499,8 +499,8 @@ def mountEcryptfs(userName, userPwd, userDir):
userPwd: пароль пользователя
userDir: домашний каталог пользователя
"""
from calculate.lib.utils.files import (process, readLinesFile, STDOUT)
from calculate.lib.utils.mount import isMount
from ..utils.files import (process, readLinesFile, STDOUT)
from ..utils.mount import isMount
if ".Private" in isMount(userDir):
return True
@ -558,7 +558,7 @@ def isBootstrapDataOnly(user_dir):
Каталог содержит только сертификат, созданный командой cl-core
а так же настроенные симлинки на .face, skel
"""
from calculate.lib.utils.files import find
from ..utils.files import find
max_diff = 10
skel_files = set([x for x in find('/etc/skel', onefilesystem=True,
fullpath=False)
@ -595,7 +595,7 @@ def get_fastlogin_domain_path(dv):
Получить пути до ресурсов для определения нужно ли выполнять
шаблоны для доменного профиля пользователя
"""
from calculate.lib.cl_template import LayeredIni
from ..cl_template import LayeredIni
overlay_suffix_path = 'profiles/templates'
template_paths = dv.Get('main.cl_template_path')
for template_path in template_paths:

@ -14,11 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from calculate.lib.utils.device import (Sysfs, UdevAdm, sysfs, Devfs, Udev, Lvm,
from .device import (Sysfs, UdevAdm, sysfs, Devfs, Udev, Lvm,
UdevAdmNull, LvmCommand, MdadmCommand,
Raid)
from calculate.lib.utils.files import writeFile
from calculate.lib.utils.vfs import (VFSKeeper, VFSSysfsImporter,
from .files import writeFile
from .vfs import (VFSKeeper, VFSSysfsImporter,
SafeVFS,
VFSDevfsImporter)
import os

@ -19,11 +19,11 @@ import sys
import re
import os
from os import path
from calculate.lib.utils.tools import (Cachable, GenericFs, unique)
from .tools import (Cachable, GenericFs, unique)
from . import files
from time import sleep
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -41,7 +41,7 @@ import signal
from functools import reduce
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])
@ -82,7 +82,7 @@ except ImportError as e:
MAGIC_MIME_TYPE = 0x010
MAGIC_MIME_ENCODING = 0x400
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -18,17 +18,17 @@ import re
import sys
import os
from os import path
from calculate.lib.configparser import ConfigParser
from ..configparser import ConfigParser
import shutil
from calculate.lib.utils.files import (getProgPath, STDOUT,
from .files import (getProgPath, STDOUT,
PercentProgress, process, readFile,
writeFile, listDirectory, removeDir)
from calculate.lib.utils.tools import AddonError
from calculate.lib.utils.ip import check_port
from .tools import AddonError
from .ip import check_port
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -14,12 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from calculate.lib.utils.files import (process, getProgPath, makeDirectory,
from .files import (process, getProgPath, makeDirectory,
removeDir, FilesError)
import os
import sys
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])
@ -97,7 +97,7 @@ class GPG():
timeout=self.timeout)
def recv_keys(self, keyid):
return _spawn_gpg("--recv-keys", keyid).success()
return self._spawn_gpg("--recv-keys", keyid).success()
def import_key(self, keyfile):
p = self._spawn_gpg("--import")

@ -16,10 +16,10 @@
import sys
from calculate.lib.utils.files import getProgPath, process
from .files import getProgPath, process
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -30,7 +30,7 @@ from os import path
import select
import time
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -20,7 +20,7 @@ import re
from os import path
from .files import typeFile, process
from subprocess import Popen, PIPE
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -18,7 +18,7 @@
import sys
import os
import re
from calculate.lib.utils.tools import SingletonParam
from .tools import SingletonParam
from . import files
from . import device
import errno
@ -29,7 +29,7 @@ import tempfile
from functools import reduce
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -15,10 +15,10 @@
# limitations under the License.
import sys
from calculate.lib.utils.files import process
from .files import process
from os import path
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -15,13 +15,13 @@
# limitations under the License.
import sys
from abc import ABCMeta, abstractmethod
from calculate.lib.utils.files import process, getProgPath
from calculate.lib.utils.tools import Sizes, classificate, traverse
from calculate.lib.utils.device import humanreadableSize
from .files import process, getProgPath
from .tools import Sizes, classificate, traverse
from .device import humanreadableSize
import re
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -23,9 +23,9 @@ import datetime
import functools
import bz2
from calculate.lib.cl_xml import ET
from ..cl_xml import ET
import pexpect
from calculate.lib.configparser import ConfigParser
from ..configparser import ConfigParser
from .colortext.palette import TextState
from .common import cmpVersion
@ -48,7 +48,7 @@ Colors = TextState.Colors
import glob
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -15,11 +15,11 @@
# limitations under the License.
import sys
from calculate.lib.utils.files import getProgPath, process
from .files import getProgPath, process
import re
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -14,15 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
from calculate.lib.utils.files import grepFile, getRunCommands
from calculate.lib.utils.tools import cached, traverse
from .files import grepFile, getRunCommands
from .tools import cached, traverse
from os import path
import os
from collections import defaultdict
from fnmatch import fnmatch, filter as fnfilter
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -14,12 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from calculate.lib import cl_overriding
from .. import cl_overriding
import re
import sys
from itertools import *
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -18,7 +18,7 @@ from os import path
import bz2
import os
import shutil
from calculate.lib.utils.files import readFile, listDirectory
from .files import readFile, listDirectory
class VardbPackage():
"""

@ -15,7 +15,7 @@
# limitations under the License.
import os
from calculate.lib.utils.files import readFile
from .files import readFile
from collections import deque
from collections.abc import Mapping
from os import path

@ -17,9 +17,9 @@
import sys
import re
from calculate.lib.cl_lang import setLocalTranslate
import calculate.lib.utils.device as device
from calculate.lib.utils.files import process, getProgPath
from ..cl_lang import setLocalTranslate
from . import device
from .files import process, getProgPath
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -15,13 +15,13 @@
# limitations under the License.
import os
import re
from calculate.lib.datavars import Variable, ReadonlyVariable, DataVarsError
from calculate.lib.utils.files import process, FilesError, readFile
from calculate.lib.utils.common import (
from ..datavars import Variable, ReadonlyVariable, DataVarsError
from ..utils.files import process, FilesError, readFile
from ..utils.common import (
getValueFromCmdLine, getVideoFromXorgLog, getVideoFromXorgConf,
getVideoFromCmdLine, getCompositeFromXorgconf, getTupleVersion,
getVideoFromModules, getVideoFromVendor, getInstalledVideo, CmdlineParams)
from calculate.lib.utils.portage import isPkgInstalled
from ..utils.portage import isPkgInstalled
from math import sqrt

@ -15,7 +15,7 @@
# limitations under the License.
import sys
from calculate.lib.datavars import ReadonlyVariable
from ..datavars import ReadonlyVariable
from . import X11
from . import locale
@ -26,7 +26,7 @@ from . import net
from . import user
from . import system
from . import action
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3',sys.modules[__name__])
section = "main"

@ -15,10 +15,10 @@
# limitations under the License.
import sys
from calculate.lib.datavars import (Variable, VariableError)
from ..datavars import (Variable, VariableError)
from calculate.lib.cl_lang import setLocalTranslate
from calculate.lib.cl_template import Template
from ..cl_lang import setLocalTranslate
from ..cl_template import Template
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -18,15 +18,15 @@ import os
import sys
from os import path
from itertools import *
from calculate.lib.datavars import (TableVariable, Variable, ReadonlyVariable,
from ..datavars import (TableVariable, Variable, ReadonlyVariable,
VariableError, ReadonlyTableVariable,
FieldValue, HumanReadable)
from calculate.lib.utils.files import (listDirectory, process, PIPE, pathJoin,
from ..utils.files import (listDirectory, process, PIPE, pathJoin,
readFileEx)
from calculate.lib.utils.portage import (isPkgInstalled, RepositoryPath,
from ..utils.portage import (isPkgInstalled, RepositoryPath,
getInstalledAtom, getPortagePython)
from calculate.lib.utils.common import cmpVersion
from calculate.lib.datavars import DataVars
from ..utils.common import cmpVersion
from ..datavars import DataVars
from itertools import dropwhile
import re
import contextlib
@ -34,7 +34,7 @@ import multiprocessing
from collections import namedtuple
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -17,13 +17,12 @@
import sys
import os
import re
from calculate.lib.datavars import ReadonlyVariable
from calculate.lib.utils.files import readFile, readLinesFile
import calculate.lib.utils.device as device
from calculate.lib.utils.device import lspci
from ..datavars import ReadonlyVariable
from ..utils.files import readFile, readLinesFile
from ..utils import device
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])
@ -96,7 +95,7 @@ class VariableHrVirtual(ReadonlyVariable):
'VMware': 'vmware',
'Qumranet': 'qemu'}
re_virt_info = re.compile("|".join(virt_sys_dict.keys()))
devices = lspci(re_virt_info.search)
devices = device.lspci(re_virt_info.search)
for device in devices.values():
name_res = re_virt_info.search(device['name'])
if not name_res:
@ -197,7 +196,7 @@ class VariableHrVideoName(ReadonlyVariable):
self.label = _("Videocard")
def get(self):
pci_video = list(sorted(lspci("VGA compatible").items()))
pci_video = list(sorted(device.lspci("VGA compatible").items()))
if pci_video:
pci_video = pci_video[0][1]
vendor = pci_video.get("vendor", "").split(" ")[0]

@ -19,18 +19,18 @@ import os
from os import path
import re
import platform
from calculate.lib.datavars import (Variable, SimpleDataVars, ReadonlyVariable,
from ..datavars import (Variable, SimpleDataVars, ReadonlyVariable,
VariableError, VariableInterface)
from calculate.lib.utils.portage import (isPkgInstalled, searchProfile,
from ..utils.portage import (isPkgInstalled, searchProfile,
RepositorySubstituting, RepositoryPath)
from calculate.lib.utils.files import readFile, pathJoin
from calculate.lib.configparser import ConfigParser
from calculate.lib.utils.tools import unique, drop_slash
from ..utils.files import readFile, pathJoin
from ..configparser import ConfigParser
from ..utils.tools import unique, drop_slash
from . import env
_ = lambda x: x
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -16,14 +16,14 @@
from os import path
import os
from calculate.lib.datavars import ReadonlyVariable
from calculate.lib.utils.common import (getValueFromCmdLine, getXorgConfContent,
from ..datavars import ReadonlyVariable
from ..utils.common import (getValueFromCmdLine, getXorgConfContent,
getValueFromConfig, CmdlineParams)
from calculate.lib.utils.format import XorgConfig
from ..utils.format import XorgConfig
from collections import OrderedDict
import sys
from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate
from ..cl_lang import setLocalTranslate, getLazyLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])

@ -15,8 +15,8 @@
# limitations under the License.
import socket
from calculate.lib.datavars import ReadonlyVariable
from calculate.lib.utils import ip
from ..datavars import ReadonlyVariable
from ..utils import ip
class VariableOsNetHostname(ReadonlyVariable):

@ -19,15 +19,15 @@ from os import path, R_OK
import platform
import re
import errno
from calculate.lib.utils.dracut import Dracut
from calculate.lib.datavars import Variable, ReadonlyVariable
from calculate.lib.utils.files import (readFile, process, listDirectory,
from ..utils.dracut import Dracut
from ..datavars import Variable, ReadonlyVariable
from ..utils.files import (readFile, process, listDirectory,
pathJoin)
from calculate.lib.utils.mount import isMount, Mounts
from calculate.lib.utils.system import SystemType
import calculate.lib.utils.device as device
from calculate.lib.utils.device import loadEfiVars
from calculate.lib.utils.common import getKernelUid, getValueFromCmdLine, \
from ..utils.mount import isMount, Mounts
from ..utils.system import SystemType
from ..utils import device
from ..utils.device import loadEfiVars
from ..utils.common import getKernelUid, getValueFromCmdLine, \
CmdlineParams

@ -18,17 +18,17 @@ import os
import pwd
import grp
from os import environ, path
from calculate.lib.datavars import Variable, VariableError, ReadonlyVariable
from calculate.lib.utils.common import getPasswdUsers, isBootstrapDataOnly
from calculate.lib.utils.files import listDirectory
from ..datavars import Variable, VariableError, ReadonlyVariable
from ..utils.common import getPasswdUsers, isBootstrapDataOnly
from ..utils.files import listDirectory
import sys
from calculate.lib.cl_lang import setLocalTranslate
from ..cl_lang import setLocalTranslate
_ = lambda x: x
setLocalTranslate('cl_lib3', sys.modules[__name__])
try:
from calculate.lib.cl_ldap import ldapUser, ldap
from ..cl_ldap import ldapUser, ldap
except ImportError:
ldapUser = None
ldap = None

Loading…
Cancel
Save