* new translations, cosmetic changes
* specfile: don't bail if there is no comment, name, email
This commit is contained in:
@@ -30,13 +30,13 @@ def handle_exception(exception, value, tb):
|
|||||||
ui = pisi.cli.CLI() # make a temporary UI
|
ui = pisi.cli.CLI() # make a temporary UI
|
||||||
show_traceback = False
|
show_traceback = False
|
||||||
if exception == exceptions.KeyboardInterrupt:
|
if exception == exceptions.KeyboardInterrupt:
|
||||||
ui.error(_("\nKeyboardInterrupt: Exiting...\n"))
|
ui.error(_("KeyboardInterrupt: Exiting...\n"))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif exception == XmlError:
|
elif exception == XmlError:
|
||||||
ui.error(unicode(value))
|
ui.error(unicode(value))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif isinstance(value, pisi.Error):
|
elif isinstance(value, pisi.Error):
|
||||||
ui.error(_("\nFatal Error. Program Terminated."))
|
ui.error(_("Fatal Error. Program Terminated."))
|
||||||
show_traceback = ctx.config.get_option('debug')
|
show_traceback = ctx.config.get_option('debug')
|
||||||
elif isinstance(value, pisi.Exception):
|
elif isinstance(value, pisi.Exception):
|
||||||
show_traceback = True
|
show_traceback = True
|
||||||
@@ -47,7 +47,7 @@ Please file a bug report. (http://bugs.uludag.org.tr)"""))
|
|||||||
# For any other exception (possibly Python exceptions) show
|
# For any other exception (possibly Python exceptions) show
|
||||||
# the traceback!
|
# the traceback!
|
||||||
show_traceback = ctx.config.get_option('debug')
|
show_traceback = ctx.config.get_option('debug')
|
||||||
ui.error(_("\nSystem Error. Program Terminated."))
|
ui.error(_("System Error. Program Terminated."))
|
||||||
|
|
||||||
ui.error("%s: %s\n" % (exception, value))
|
ui.error("%s: %s\n" % (exception, value))
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ def lib_insinto(sourceFile, destinationDirectory, permission = 0644):
|
|||||||
'''inserts a library fileinto destinationDirectory with given permission'''
|
'''inserts a library fileinto destinationDirectory with given permission'''
|
||||||
|
|
||||||
if not sourceFile or not destinationDirectory:
|
if not sourceFile or not destinationDirectory:
|
||||||
raise ArgumentError(_(' Insufficient arguments.'))
|
raise ArgumentError(_('Insufficient arguments.'))
|
||||||
|
|
||||||
if not can_access_directory(destinationDirectory):
|
if not can_access_directory(destinationDirectory):
|
||||||
makedirs(destinationDirectory)
|
makedirs(destinationDirectory)
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ def makedirs(destinationDirectory):
|
|||||||
if not os.access(destinationDirectory, os.F_OK):
|
if not os.access(destinationDirectory, os.F_OK):
|
||||||
os.makedirs(destinationDirectory)
|
os.makedirs(destinationDirectory)
|
||||||
except OSError:
|
except OSError:
|
||||||
error(_('Cannot create directory %s' % destinationDirectory))
|
error(_('Cannot create directory %s') % destinationDirectory)
|
||||||
|
|
||||||
def echo(destionationFile, content):
|
def echo(destionationFile, content):
|
||||||
try:
|
try:
|
||||||
@@ -61,10 +61,10 @@ def chmod(sourceFile, mode = 0755):
|
|||||||
try:
|
try:
|
||||||
os.chmod(file, mode)
|
os.chmod(file, mode)
|
||||||
except OSError:
|
except OSError:
|
||||||
ctx.ui.error(_(' ActionsAPI [chmod]: Operation not permitted: %s (mode: %s)') \
|
ctx.ui.error(_('ActionsAPI [chmod]: Operation not permitted: %s (mode: %s)') \
|
||||||
% (file, mode))
|
% (file, mode))
|
||||||
else:
|
else:
|
||||||
ctx.ui.error(_(' ActionsAPI [chmod]: File %s doesn\'t exists.') % (file))
|
ctx.ui.error(_('ActionsAPI [chmod]: File %s doesn\'t exists.') % (file))
|
||||||
|
|
||||||
def chown(sourceFile, uid = "root", gid = "root"):
|
def chown(sourceFile, uid = "root", gid = "root"):
|
||||||
'''change the owner and group id of sourceFile to uid and gid'''
|
'''change the owner and group id of sourceFile to uid and gid'''
|
||||||
@@ -72,17 +72,17 @@ def chown(sourceFile, uid = "root", gid = "root"):
|
|||||||
try:
|
try:
|
||||||
os.chown(sourceFile, pwd.getpwnam(uid)[2], grp.getgrnam(gid)[2])
|
os.chown(sourceFile, pwd.getpwnam(uid)[2], grp.getgrnam(gid)[2])
|
||||||
except OSError:
|
except OSError:
|
||||||
ctx.ui.error(_(' ActionsAPI [chown]: Operation not permitted: %s (uid: %s, gid: %s)') \
|
ctx.ui.error(_('ActionsAPI [chown]: Operation not permitted: %s (uid: %s, gid: %s)') \
|
||||||
% (sourceFile, uid, gid))
|
% (sourceFile, uid, gid))
|
||||||
else:
|
else:
|
||||||
ctx.ui.error(_(' ActionsAPI [chown]: File %s doesn\'t exists.') % sourceFile)
|
ctx.ui.error(_('ActionsAPI [chown]: File %s doesn\'t exists.') % sourceFile)
|
||||||
|
|
||||||
def sym(sourceFile, destinationFile):
|
def sym(sourceFile, destinationFile):
|
||||||
'''creates symbolic link'''
|
'''creates symbolic link'''
|
||||||
try:
|
try:
|
||||||
os.symlink(sourceFile, destinationFile)
|
os.symlink(sourceFile, destinationFile)
|
||||||
except OSError:
|
except OSError:
|
||||||
ctx.ui.error(_(' ActionsAPI [sym]: Permission denied: %s to %s') % (file, destinationFile))
|
ctx.ui.error(_('ActionsAPI [sym]: Permission denied: %s to %s') % (file, destinationFile))
|
||||||
|
|
||||||
def unlink(sourceFile):
|
def unlink(sourceFile):
|
||||||
'''remove the file path'''
|
'''remove the file path'''
|
||||||
@@ -90,11 +90,11 @@ def unlink(sourceFile):
|
|||||||
try:
|
try:
|
||||||
os.unlink(sourceFile)
|
os.unlink(sourceFile)
|
||||||
except OSError:
|
except OSError:
|
||||||
ctx.ui.error(_(' ActionsAPI [unlink]: Permission denied: %s.') % (sourceFile))
|
ctx.ui.error(_('ActionsAPI [unlink]: Permission denied: %s.') % (sourceFile))
|
||||||
elif isDirectory(sourceFile):
|
elif isDirectory(sourceFile):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ctx.ui.error(_(' ActionsAPI [unlink]: File %s doesn\'t exists.') % (sourceFile))
|
ctx.ui.error(_('ActionsAPI [unlink]: File %s doesn\'t exists.') % (sourceFile))
|
||||||
|
|
||||||
def unlinkDir(sourceDirectory):
|
def unlinkDir(sourceDirectory):
|
||||||
'''delete an entire directory tree'''
|
'''delete an entire directory tree'''
|
||||||
@@ -102,11 +102,11 @@ def unlinkDir(sourceDirectory):
|
|||||||
try:
|
try:
|
||||||
shutil.rmtree(sourceDirectory)
|
shutil.rmtree(sourceDirectory)
|
||||||
except OSError:
|
except OSError:
|
||||||
error(_(' ActionsAPI [unlinkDir]: Operation not permitted: %s') % (sourceDirectory))
|
error(_('ActionsAPI [unlinkDir]: Operation not permitted: %s') % (sourceDirectory))
|
||||||
elif isFile(sourceDirectory):
|
elif isFile(sourceDirectory):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
error(_(' ActionsAPI [unlinkDir]: Directory %s doesn\'t exists.') % (sourceDirectory))
|
error(_('ActionsAPI [unlinkDir]: Directory %s doesn\'t exists.') % (sourceDirectory))
|
||||||
|
|
||||||
def move(sourceFile, destinationFile):
|
def move(sourceFile, destinationFile):
|
||||||
'''recursively move a sourceFile or directory to destinationFile'''
|
'''recursively move a sourceFile or directory to destinationFile'''
|
||||||
@@ -115,9 +115,9 @@ def move(sourceFile, destinationFile):
|
|||||||
try:
|
try:
|
||||||
shutil.move(file, destinationFile)
|
shutil.move(file, destinationFile)
|
||||||
except OSError:
|
except OSError:
|
||||||
error(_(' ActionsAPI [move]: Permission denied: %s to %s') % (file, destinationFile))
|
error(_('ActionsAPI [move]: Permission denied: %s to %s') % (file, destinationFile))
|
||||||
else:
|
else:
|
||||||
error(_(' ActionsAPI [move]: File %s doesn\'t exists.') % (file))
|
error(_('ActionsAPI [move]: File %s doesn\'t exists.') % (file))
|
||||||
|
|
||||||
def copy(sourceFile, destinationFile):
|
def copy(sourceFile, destinationFile):
|
||||||
'''recursively copy a sourceFile or directory to destinationFile'''
|
'''recursively copy a sourceFile or directory to destinationFile'''
|
||||||
@@ -138,9 +138,9 @@ def copytree(source, destination, sym = False):
|
|||||||
try:
|
try:
|
||||||
shutil.copytree(source, destination, sym)
|
shutil.copytree(source, destination, sym)
|
||||||
except OSError:
|
except OSError:
|
||||||
error(_(' ActionsAPI [copytree]: Permission denied: %s to %s') % (source, destination))
|
error(_('ActionsAPI [copytree]: Permission denied: %s to %s') % (source, destination))
|
||||||
else:
|
else:
|
||||||
error(_(' ActionsAPI [copytree]: Directory %s doesn\'t exists.') % (source))
|
error(_('ActionsAPI [copytree]: Directory %s doesn\'t exists.') % (source))
|
||||||
|
|
||||||
def touch(sourceFile):
|
def touch(sourceFile):
|
||||||
'''changes the access time of the 'sourceFile', or creates it if it is not exist'''
|
'''changes the access time of the 'sourceFile', or creates it if it is not exist'''
|
||||||
@@ -152,7 +152,7 @@ def touch(sourceFile):
|
|||||||
f = open(sourceFile, 'w')
|
f = open(sourceFile, 'w')
|
||||||
f.close()
|
f.close()
|
||||||
except IOError:
|
except IOError:
|
||||||
error(_(' ActionsAPI [touch]: Permission denied: %s') % (sourceFile))
|
error(_('ActionsAPI [touch]: Permission denied: %s') % (sourceFile))
|
||||||
|
|
||||||
def cd(directoryName = ''):
|
def cd(directoryName = ''):
|
||||||
'''change directory'''
|
'''change directory'''
|
||||||
|
|||||||
+7
-4
@@ -150,11 +150,14 @@ class UpdateInfo:
|
|||||||
node.setAttribute("release", self.release)
|
node.setAttribute("release", self.release)
|
||||||
xml.addTextNodeUnder(node, "Date", self.date)
|
xml.addTextNodeUnder(node, "Date", self.date)
|
||||||
xml.addTextNodeUnder(node, "Version", self.version)
|
xml.addTextNodeUnder(node, "Version", self.version)
|
||||||
xml.addTextNodeUnder(node, "Comment", self.comment)
|
if self.comment:
|
||||||
xml.addTextNodeUnder(node, "Name", self.name)
|
xml.addTextNodeUnder(node, "Comment", self.comment)
|
||||||
xml.addTextNodeUnder(node, "Email", self.email)
|
if self.name:
|
||||||
|
xml.addTextNodeUnder(node, "Name", self.name)
|
||||||
|
if self.email:
|
||||||
|
xml.addTextNodeUnder(node, "Email", self.email)
|
||||||
if self.type:
|
if self.type:
|
||||||
node.setAttribute("type", self.type)
|
node.setAttribute("type", self.type)
|
||||||
return node
|
return node
|
||||||
|
|
||||||
def has_errors(self):
|
def has_errors(self):
|
||||||
|
|||||||
+388
-368
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user