bu Checks sınıfı kullanılmıyordu.
This commit is contained in:
@@ -540,7 +540,7 @@ def resurrect_package(package_fn, write_files, txn = None):
|
||||
|
||||
errs = metadata.errors()
|
||||
if errs:
|
||||
util.Checks.print_errors(errs)
|
||||
util.print_errors(errs)
|
||||
raise Error, _("MetaData format wrong (%s)") % package_fn
|
||||
|
||||
ctx.ui.info(_('* Adding \'%s\' to db... ') % (metadata.package.name), noln=True)
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ class Package:
|
||||
self.metadata.read( join(outdir, ctx.const.metadata_xml) )
|
||||
errs = self.metadata.errors()
|
||||
if errs:
|
||||
util.Checks.print_errors(errs)
|
||||
util.print_errors(errs)
|
||||
raise Error, _("MetaData format wrong")
|
||||
|
||||
self.files = Files()
|
||||
|
||||
+3
-20
@@ -42,27 +42,10 @@ class FileError(Error):
|
||||
# spec validation utility #
|
||||
#########################
|
||||
|
||||
class Checks:
|
||||
def __init__(self):
|
||||
self.list = []
|
||||
def print_errors(errlist):
|
||||
for err in errlist:
|
||||
ctx.ui.error(err)
|
||||
|
||||
def add(self, err):
|
||||
self.list.append(err)
|
||||
|
||||
def join(self, list):
|
||||
self.list.extend(list)
|
||||
|
||||
def has_tag(self, var, section, name):
|
||||
if not var:
|
||||
self.list.append(_("%s section should have a '%s' tag") % (section, name))
|
||||
|
||||
def has_error(self):
|
||||
return len(self.list)>0
|
||||
|
||||
def print_errors(list):
|
||||
for x in list:
|
||||
ctx.ui.error(x)
|
||||
print_errors = staticmethod(print_errors)
|
||||
|
||||
#########################
|
||||
# string/list/functional#
|
||||
|
||||
Reference in New Issue
Block a user