entropy.server: code style update
This commit is contained in:
@@ -148,7 +148,9 @@ class Repository:
|
||||
|
||||
self.__validate_repository_id(repo)
|
||||
|
||||
cmethod = etpConst['etpdatabasecompressclasses'].get(self.Entropy.SystemSettings['repositories']['available'][repo]['dbcformat'])
|
||||
repo_settings = self.Entropy.SystemSettings['repositories']
|
||||
dbc_format = repo_settings['available'][repo]['dbcformat']
|
||||
cmethod = etpConst['etpdatabasecompressclasses'].get(dbc_format)
|
||||
if cmethod == None:
|
||||
mytxt = _("Wrong database compression method")
|
||||
raise InvalidDataType("InvalidDataType: %s" % (mytxt,))
|
||||
@@ -263,7 +265,8 @@ class Repository:
|
||||
if self.dbformat_eapi == 1:
|
||||
myfile = self.Entropy.SystemSettings['repositories']['available'][repo]['dbpath']+"/"+etpConst[cmethod[2]]
|
||||
try:
|
||||
path = eval("self.entropyTools."+cmethod[1])(myfile)
|
||||
myfunc = getattr(self.entropyTools, cmethod[1])
|
||||
path = myfunc(myfile)
|
||||
except EOFError:
|
||||
rc = 1
|
||||
if os.path.isfile(myfile):
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
from __future__ import with_statement
|
||||
import sys, os, stat
|
||||
from entropy.i18n import _
|
||||
import gzip
|
||||
import bz2
|
||||
|
||||
# ETP_ARCH_CONST setup
|
||||
ETP_ARCH_CONST = "x86"
|
||||
@@ -291,9 +293,9 @@ def const_default_settings(rootdir):
|
||||
# Entropy compressed databases format support
|
||||
'etpdatabasesupportedcformats': ["bz2", "gz"],
|
||||
'etpdatabasecompressclasses': {
|
||||
"bz2": ("bz2.BZ2File", "unpack_bzip2", "etpdatabasefilebzip2",
|
||||
"bz2": (bz2.BZ2File, "unpack_bzip2", "etpdatabasefilebzip2",
|
||||
"etpdatabasedumpbzip2", "etpdatabasedumphashfilebz2"),
|
||||
"gz": ("gzip.GzipFile", "unpack_gzip", "etpdatabasefilegzip",
|
||||
"gz": (gzip.GzipFile, "unpack_gzip", "etpdatabasefilegzip",
|
||||
"etpdatabasedumpgzip", "etpdatabasedumphashfilegzip")
|
||||
},
|
||||
# enable/disable packages RSS feed feature
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user