Kaydet (Commit) 18b199ad authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Python3 ile ilgili çok dağinik bir kullanım var. bir standartımız olmalı

üst 61bb24e4
......@@ -44,7 +44,7 @@ def handle_exception(exception, value, tb):
elif isinstance(value, inary.Exception):
show_traceback = True
ui.error(_("Unhandled internal exception.\n"
"Please file a bug report to <http://bugs.pardus.org.tr>."))
"Please file a bug report to <http://bugs.sulin.org>."))
elif isinstance(value, IOError) and value.errno == errno.EPIPE:
# Ignore broken pipe errors
sys.exit(0)
......
......@@ -31,8 +31,8 @@ from inary.actionsapi.shelltools import system, export
EXEC_TEMPLATE = """\
#!/bin/sh
cd %s
java%s-jar %s%s
cd {0}
java{1}-jar {2}{3}
"""
......@@ -81,8 +81,7 @@ def _dodoc(*source_files, **kw):
for source_file in source_files:
sources = glob(source_file)
if not sources:
raise DoJavadocError(_('No any file/directory matched '
'to regex expression "%s".' % source_file))
raise DoJavadocError(_('No any file/directory matched to regex expression "{}".'.format(source_file)))
for source in sources:
if os.path.isfile(source):
......@@ -112,7 +111,7 @@ def _generate_classpath_file(classpath):
prefix = ':'
cp_file = open(env_file, 'a')
cp_file.write('%s%s' % (prefix, ':'.join(classpath)))
cp_file.write('{0}{1}'.format(prefix, ':'.join(classpath)))
cp_file.close()
......@@ -127,7 +126,7 @@ def _generate_exec_file(dest_dir, exe, java_args, exe_args):
exec_file = os.open(util.join_path(exec_dir, get.srcNAME()),
os.O_CREAT | os.O_WRONLY,
0o755)
os.write(exec_file, EXEC_TEMPLATE % (util.join_path('/', dest_dir),
os.write(exec_file, EXEC_TEMPLATE.format(util.join_path('/', dest_dir),
java_args,
exe,
exe_args))
......@@ -158,7 +157,7 @@ def installExe(exe='', java_args='', exe_args='', dest_dir=''):
dest_dir: Installation dir of executable jar'''
if not dest_dir:
dest_dir = 'usr/share/java/%s' % get.srcNAME()
dest_dir = 'usr/share/java/{}'.format(get.srcNAME())
destination = util.join_path(get.installDIR(), dest_dir)
if not os.access(destination, os.F_OK):
......@@ -170,10 +169,10 @@ def installExe(exe='', java_args='', exe_args='', dest_dir=''):
copy(exe, destination)
_generate_exec_file(dest_dir,
source,
' %s ' % java_args if java_args else ' ',
' %s' % exe_args if exe_args else '')
' {} '.format(java_args) if java_args else ' ',
' {}'.format(exe_args) if exe_args else '')
except IOError:
raise InstallError(_('Installing file "%s" failed.' % exe))
raise InstallError(_('Installing file "{}" failed.'.format(exe)))
def installLib(src='*.jar', dest='/usr/share/java'):
......@@ -192,7 +191,7 @@ def installLib(src='*.jar', dest='/usr/share/java'):
# If no source matched, then no need to create destination dir
if not sources:
raise InstallError(_('No any file/directory matched '
'to regex expression "%s".' % src))
'to regex expression "{}".'.format(src)))
if not os.access(destination, os.F_OK):
os.makedirs(destination)
......@@ -202,8 +201,7 @@ def installLib(src='*.jar', dest='/usr/share/java'):
try:
copy(source, destination)
except IOError:
raise InstallError(_('Installing file "%s" '
'failed.' % source))
raise InstallError(_('Installing file "{}" failed.'.format(source)))
if source.endswith('.jar'):
classpath.append(util.join_path('/',
dest,
......@@ -213,8 +211,7 @@ def installLib(src='*.jar', dest='/usr/share/java'):
try:
copytree(source, target)
except IOError:
raise InstallError(_('Installing directory "%s" '
'failed.' % source))
raise InstallError(_('Installing directory "{}" failed.'.format(source)))
for root, dirs, files in os.walk(target):
for f in files:
if f.endswith('.jar'):
......@@ -258,5 +255,5 @@ def run(argument='', parameters='', build_tool='ant'):
# Otherwise, javadoc might be completed with errors
export('LC_ALL', 'en_US.UTF-8')
if system('%s %s %s' % (build_tool, parameters, argument)):
if system('{0} {1} {2}'.format(build_tool, parameters, argument)):
raise RunTimeError(_('Run failed.'))
......@@ -61,7 +61,7 @@ def configure(projectfile='', parameters='', installPrefix=prefix):
profiles = glob.glob("*.pro")
if len(profiles) > 1 and projectfile == '':
raise ConfigureError(_("It seems there are more than one .pro file, you must specify one. (Possible .pro files: %s)") % ", ".join(profiles))
raise ConfigureError(_("It seems there are more than one .pro file, you must specify one. (Possible .pro files: {})").format(", ".join(profiles)))
shelltools.system("{0} -makefile {1} PREFIX='{2}' QMAKE_CFLAGS+='{3.CFLAGS()}' QMAKE_CXXFLAGS+='{3.CXXFLAGS()}' {5}".format(qmake, projectfile, installPrefix, get, parameters))
......
......@@ -164,9 +164,9 @@ class Build(command.Command, metaclass=command.autocommand):
ctx.ui.info(_("Supported package formats:"))
for format in inary.package.Package.formats:
if format == inary.package.Package.default_format:
ctx.ui.info(_(" %s (default)") % format)
ctx.ui.info(_(" {} (default)") % format)
else:
ctx.ui.info(" %s" % format)
ctx.ui.info(" {}" % format)
return
self.init()
......
......@@ -71,7 +71,7 @@ You can also give the name of a component.
emerge_up_list.append(package)
if ctx.get_option('output_dir'):
ctx.ui.info(_('Output directory: %s') % ctx.config.options.output_dir)
ctx.ui.info(_('Output directory: {}').format(ctx.config.options.output_dir))
else:
ctx.ui.info(_('Outputting binary packages in the package cache.'))
ctx.config.options.output_dir = ctx.config.cached_packages_dir()
......
......@@ -92,7 +92,7 @@ class Index(xmlfile.XmlFile, metaclass=autoxml.autoxml):
pkgpath = os.path.join(repo_uri,
util.parse_package_dir_path(fn))
if not os.path.isdir(pkgpath): os.makedirs(pkgpath)
ctx.ui.info("%-80.80s\r" % (_('Sorting: %s').format(fn)),
ctx.ui.info("%-80.80s\r" % (_('Sorting: {}').format(fn)),
noln = False if ctx.config.get_option("verbose") else True)
shutil.copy2(os.path.join(repo_uri, fn), pkgpath)
os.remove(os.path.join(repo_uri, fn))
......
......@@ -19,7 +19,7 @@ WorkDir = "skeleton"
def install():
inarytools.dobin("skeleton.py")
inarytools.rename("/usr/bin/skeleton.py", "%s")
inarytools.rename("/usr/bin/skeleton.py", "{}")
"""
def __init__(self, name, filepath):
......@@ -27,4 +27,4 @@ def install():
self.filepath = filepath
def write(self):
open(self.filepath, "w").write(self.template % self.name)
open(self.filepath, "w").write(self.template.format(self.name))
......@@ -16,13 +16,13 @@ class _constant:
def __setattr__(self, name, value):
if name in self.__dict__:
raise self.ConstError("Can't rebind constant: %s" % name)
raise self.ConstError("Can't rebind constant: {}".format(name))
# Binding an attribute once to a const is available
self.__dict__[name] = value
def __delattr__(self, name):
if name in self.__dict__:
raise self.ConstError("Can't unbind constant: %s" % name)
raise self.ConstError("Can't unbind constant: {}".format(name))
# we don't have an attribute by this name
raise NameError(name)
......@@ -57,8 +57,8 @@ consts.packager_name = "Faik Uygur"
consts.packager_email = "faik@pardus.org.tr"
consts.homepage = "http://cekirdek.uludag.org.tr/~faik/inary"
consts.summary = "%s is a good application"
consts.description = "%s is a free software that can do anything it wants"
consts.summary = "{} is a good application"
consts.description = "{} is a free software that can do anything it wants"
consts.license = ["GPL-2"]
consts.skel_sha1sum = "cc64dfa6e068fe1f6fb68a635878b1ea21acfac7"
......
......@@ -17,25 +17,25 @@ from inary.scenarioapi.constants import *
def inary_upgraded(*args):
packages = util.strlist(args).rstrip()
os.system("inary -D%s upgrade %s" % (consts.inary_db, packages))
os.system("inary -D{0} upgrade {1}".format(consts.inary_db, packages))
def inary_info(package):
os.system("inary -D%s info %s" % (consts.inary_db, package))
os.system("inary -D{0} info {1}".format(consts.inary_db, package))
def inary_removed(*args):
packages = util.strlist(args).rstrip()
os.system("inary -D%s remove %s" % (consts.inary_db, packages))
os.system("inary -D{0} remove {1}".format(consts.inary_db, packages))
def inary_added_repo(name, url):
os.system("inary -D%s add-repo -y %s %s" % (consts.inary_db, name, url))
os.system("inary -D{0} add-repo -y {1} {2}".format(consts.inary_db, name, url))
def inary_updated_repo():
os.system("inary -D%s update-repo" % consts.inary_db)
os.system("inary -D{0} update-repo".fotmat(consts.inary_db))
def inary_installed(*args):
packages = util.strlist(args).rstrip()
os.system("inary -D%s install %s" % (consts.inary_db, packages))
os.system("inary -D{0} install {1}".format(consts.inary_db, packages))
def inary_reinstalled(package):
os.system("inary -D%s install --reinstall %s" % (consts.inary_db, package))
os.system("inary -D{0} install --reinstall {1}".format(consts.inary_db, package))
......@@ -36,12 +36,12 @@ class Package:
self.create_package()
def create_inary(self):
os.system("inary build %s -O %s > /dev/null 2>&1" % (consts.pspec_path, consts.repo_path))
os.system("inary build {0} -O {1} > /dev/null 2>&1".format(consts.pspec_path, consts.repo_path))
def create_package(self):
pspec = Pspec(self.name, consts.pspec_path)
pspec.set_source(consts.homepage, consts.summary % self.name,
consts.description % self.name, consts.license, self.partOf)
pspec.set_source(consts.homepage, consts.summary.format(self.name),
consts.description.format(self.name), consts.license, self.partOf)
pspec.set_packager(consts.packager_name, consts.packager_email)
pspec.add_archive(consts.skel_sha1sum, consts.skel_type, consts.skel_uri)
pspec.set_package(self.dependencies, self.conflicts)
......@@ -64,7 +64,7 @@ class Package:
found = glob.glob(pkg + consts.glob_inarys)
if not found:
raise Exception(_("No inary package: %s* found.") % pkg)
raise Exception(_("No inary package: {}* found.").format(pkg))
return os.path.basename(found[0])
......
......@@ -25,7 +25,7 @@ repodb = {}
def repo_added_package(package, *args):
if package in repodb:
raise Exception(_("Repo already has package named %s.") % package)
raise Exception(_("Repo already has package named {}.").format(package))
version = "1.0"
partOf = "None"
......@@ -49,14 +49,14 @@ def repo_added_package(package, *args):
def repo_removed_package(package):
if package not in repodb:
raise Exception(_("Repo does not have package named %s.") % package)
raise Exception(_("Repo does not have package named {}.").format(package))
os.unlink(os.path.join(consts.repo_path, repodb[package].get_file_name()))
del repodb[package]
def repo_version_bumped(package, *args):
if package not in repodb:
raise Exception(_("Repo does not have package named %s.") % package)
raise Exception(_("Repo does not have package named {}.").format(package))
old_file = repodb[package].get_file_name()
repodb[package].version_bump(*args)
......@@ -66,7 +66,7 @@ def repo_updated_index():
cur = os.getcwd()
path = os.path.join(cur, consts.repo_path)
os.chdir(consts.repo_path)
os.system("inary index --skip-signing %s >/dev/null 2>&1" % path)
os.system("inary index --skip-signing {} >/dev/null 2>&1".format(path))
os.chdir(cur)
def repo_get_url():
......
......@@ -25,4 +25,4 @@ def let_inary_had(*args):
url = os.path.join(os.getcwd(), consts.repo_url)
inary_added_repo(consts.repo_name, url)
packages = util.strlist(args).rstrip()
os.system("inary -D%s install --ignore-dependency %s" % (consts.inary_db, packages))
os.system("inary -D{0} install --ignore-dependency {1}".format(consts.inary_db, packages))
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: INARYLinux\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-20 18:21++03\n"
"POT-Creation-Date: 2018-01-26 10:48++03\n"
"PO-Revision-Date: 2014-02-26 16:34+0000\n"
"Last-Translator: obsoleteman <tulliana@gmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/"
......@@ -62,25 +62,25 @@ msgstr ""
"Anexar o config.log ao seu relatório de erro, Por faver:\n"
"{}/config.log"
#: inary/actionsapi/autotools.py:82 inary/actionsapi/autotools.py:92
#: inary/actionsapi/autotools.py:83 inary/actionsapi/autotools.py:93
#: inary/actionsapi/cmaketools.py:66 inary/actionsapi/kde.py:65
#: inary/actionsapi/perlmodules.py:55 inary/actionsapi/perlmodules.py:58
msgid "Configure failed."
msgstr "Configurar falhou."
#: inary/actionsapi/autotools.py:84 inary/actionsapi/autotools.py:94
#: inary/actionsapi/autotools.py:85 inary/actionsapi/autotools.py:95
#: inary/actionsapi/kde.py:67
msgid "No configure script found."
msgstr "Nenhum script configure encontrado."
#: inary/actionsapi/autotools.py:102 inary/actionsapi/cmaketools.py:78
#: inary/actionsapi/autotools.py:103 inary/actionsapi/cmaketools.py:78
#: inary/actionsapi/kde.py:72 inary/actionsapi/perlmodules.py:64
#: inary/actionsapi/perlmodules.py:73 inary/actionsapi/pythonmodules.py:62
#: inary/actionsapi/scons.py:39
msgid "Make failed."
msgstr "Make falhou."
#: inary/actionsapi/autotools.py:138 inary/actionsapi/autotools.py:149
#: inary/actionsapi/autotools.py:139 inary/actionsapi/autotools.py:150
#: inary/actionsapi/cmaketools.py:98 inary/actionsapi/cmaketools.py:106
#: inary/actionsapi/kde.py:79 inary/actionsapi/pythonmodules.py:67
#: inary/actionsapi/rubymodules.py:92 inary/actionsapi/rubymodules.py:99
......@@ -88,23 +88,23 @@ msgstr "Make falhou."
msgid "Install failed."
msgstr "Instale falhou."
#: inary/actionsapi/autotools.py:160
#: inary/actionsapi/autotools.py:161
msgid "Running aclocal failed."
msgstr "Execução de aclocal falhou."
#: inary/actionsapi/autotools.py:165
#: inary/actionsapi/autotools.py:166
msgid "Running autoconf failed."
msgstr "Execução de autoconf falhou."
#: inary/actionsapi/autotools.py:170
#: inary/actionsapi/autotools.py:171
msgid "Running autoreconf failed."
msgstr "Execução de autoreconf falhou."
#: inary/actionsapi/autotools.py:175
#: inary/actionsapi/autotools.py:176
msgid "Running automake failed."
msgstr "Execução de automake falhou."
#: inary/actionsapi/autotools.py:180
#: inary/actionsapi/autotools.py:181
msgid "Running autoheader failed."
msgstr "Execução de autoheader falhou."
......@@ -144,7 +144,7 @@ msgstr ""
#: inary/actionsapi/inarytools.py:193
#, fuzzy
msgid "ActionsAPI [rename]: {}: {}"
msgid "ActionsAPI [rename]: {0}: {1}"
msgstr "ActionsAPI [rename]: {}: {}"
#: inary/actionsapi/inarytools.py:230
......@@ -263,7 +263,11 @@ msgstr "perl Instalaçao falhou."
#: inary/actionsapi/pkgconfig.py:40 inary/actionsapi/pkgconfig.py:59
#: inary/actionsapi/pkgconfig.py:79 inary/actionsapi/pkgconfig.py:99
#: inary/actionsapi/pkgconfig.py:118 inary/actionsapi/pkgconfig.py:136
#: inary/actionsapi/pkgconfig.py:118
msgid "pkg-config is not installed on your system."
msgstr ""
#: inary/actionsapi/pkgconfig.py:136
msgid "Package pkgconfig is not installed on your system."
msgstr ""
......@@ -281,13 +285,7 @@ msgstr "Execução {} falhou."
msgid "Project file '{}' not found."
msgstr "Ficheiro de projeto {} nao foi encontrado. "
#: inary/actionsapi/qt4.py:56
msgid ""
"It seems there are more than one .pro file, you must specify one. (Possible ."
"pro files: {})"
msgstr ""
#: inary/actionsapi/qt5.py:64
#: inary/actionsapi/qt4.py:56 inary/actionsapi/qt5.py:64
msgid ""
"It seems there are more than one .pro file, you must specify one. (Possible ."
"pro files: {})"
......@@ -313,7 +311,7 @@ msgid "ActionsAPI [chmod]: No file matched pattern \"{}\"."
msgstr "Nenhum ficheiro corresponde padrão \"{}\""
#: inary/actionsapi/shelltools.py:70
msgid "ActionsAPI [chmod]: Operation not permitted: {0} (mode: 0{1})"
msgid "ActionsAPI [chmod]: Operation not permitted: %s (mode: 0%o)"
msgstr ""
#: inary/actionsapi/shelltools.py:72
......@@ -465,19 +463,19 @@ msgid "Building format file {}"
msgstr ""
#: inary/actionsapi/texlivemodules.py:263
msgid "Map {0} is added to {1.curDIR()}/{1.srcNAME()}.cfg"
msgid "Map {0} is added to {1}/{2}.cfg"
msgstr ""
#: inary/actionsapi/texlivemodules.py:266
msgid "MixedMap {0} is added to {1.curDIR()}/{1.srcNAME()}.cfg"
msgid "MixedMap {0} is added to {1}/{2}.cfg"
msgstr ""
#: inary/actionsapi/texlivemodules.py:269
msgid "p +{0} is added to {1.curDIR()}/{1.srcNAME()}-config.ps"
msgid "p +{0} is added to {1}/{2}-config.ps"
msgstr ""
#: inary/actionsapi/texlivemodules.py:272
msgid "f {0} is added to {1.curDIR()}/{1.srcNAME()}-config"
msgid "f {0} is added to {1}/{2}-config"
msgstr ""
#: inary/actionsapi/texlivemodules.py:279
......@@ -518,6 +516,10 @@ msgstr ""
msgid " release "
msgstr ""
#: inary/analyzer/ctypes.py:28
msgid "Module \"ctypes\" can not import"
msgstr ""
#: inary/archive.py:523
msgid "Problem occured while uncompressing {}.Z file"
msgstr ""
......@@ -542,7 +544,7 @@ msgstr ""
msgid "Installing {0.name}, version {0.version}, release {0.release}"
msgstr ""
#: inary/atomicoperations.py:192
#: inary/atomicoperations.py:192 inary/operations/build.py:789
msgid "{0}-{1} is not a valid INARY version format"
msgstr ""
......@@ -719,7 +721,7 @@ msgstr ""
msgid "Blame for all of the releases"
msgstr ""
#: inary/cli/blame.py:66 inary/data/specfile.py:369
#: inary/cli/blame.py:66 inary/data/specfile.py:369 inary/data/specfile.py:453
msgid "Name: {0}, version: {1}, release: {2}\n"
msgstr ""
......@@ -832,7 +834,7 @@ msgstr ""
msgid "Supported package formats:"
msgstr ""
#: inary/cli/build.py:167
#: inary/cli/build.py:167 inary/cli/delta.py:74
msgid " {} (default)"
msgstr ""
......@@ -907,7 +909,7 @@ msgstr ""
#: inary/cli/check.py:138
msgid ""
"Inary was unable to check the integrity of packages which contain files that "
"Pisi was unable to check the integrity of packages which contain files that "
"you don't have read access.\n"
"Running the check under a privileged user may help fixing this problem."
msgstr ""
......@@ -1040,10 +1042,6 @@ msgstr ""
msgid "Output directory for produced packages."
msgstr ""
#: inary/cli/delta.py:74
msgid " {} (default)"
msgstr ""
#: inary/cli/disablerepo.py:22
msgid ""
"Disable repository\n"
......@@ -1154,7 +1152,7 @@ msgstr ""
msgid "Emerge available packages under given component"
msgstr ""
#: inary/cli/emerge.py:70
#: inary/cli/emerge.py:70 inary/cli/emergeup.py:74
msgid "Output directory: {}"
msgstr ""
......@@ -1179,10 +1177,6 @@ msgstr ""
msgid "emergeup options"
msgstr "%prog [optçaos]"
#: inary/cli/emergeup.py:74
msgid "Output directory: {}"
msgstr ""
#: inary/cli/enablerepo.py:22
msgid ""
"Enable repository\n"
......@@ -2111,10 +2105,6 @@ msgstr ""
msgid "File '{}' has invalid XML"
msgstr ""
#: inary/data/specfile.py:453
msgid "Name: {0}, version: {¹}, release: {2}\n"
msgstr ""
#: inary/data/specfile.py:459
msgid "Build Dependencies: "
msgstr ""
......@@ -2123,26 +2113,38 @@ msgstr ""
msgid "Component {} not found"
msgstr ""
#: inary/db/filesldb.py:29
msgid "LevelDB not found! Please install LevelDB and plyvel!"
#: inary/db/filesdb.py:46 inary/db/filesldb.py:40
msgid "Creating files database..."
msgstr ""
#: inary/db/filesldb.py:40
msgid "Creating files database..."
#: inary/db/filesdb.py:50
msgid " ---> Adding '{}' to db... "
msgstr ""
#: inary/db/filesldb.py:47
#: inary/db/filesdb.py:53
msgid "OK."
msgstr ""
#: inary/db/filesdb.py:54 inary/db/filesldb.py:47
msgid "Added files database..."
msgstr ""
#: inary/db/filesldb.py:77
#: inary/db/filesdb.py:84
msgid "Cleaning files database folder... "
msgstr ""
#: inary/db/filesldb.py:79
#: inary/db/filesdb.py:87 inary/db/filesldb.py:79
msgid "done."
msgstr ""
#: inary/db/filesldb.py:29
msgid "LevelDB not found! Please install LevelDB and plyvel!"
msgstr ""
#: inary/db/filesldb.py:77
msgid "Cleaning files database folder... "
msgstr ""
#: inary/db/groupdb.py:66 inary/db/groupdb.py:75
msgid "Group {} not found"
msgstr ""
......@@ -2460,10 +2462,6 @@ msgstr ""
msgid "Source package '{0}' defines multiple 'Path' tags for {1}"
msgstr ""
#: inary/operations/build.py:789
msgid "{0}-{1} is not a valid INARY version format"
msgstr ""
#: inary/operations/build.py:807
msgid ""
"Safety switch: following extra packages in system.devel will be installed: "
......@@ -2612,7 +2610,7 @@ msgstr ""
#: inary/operations/downgrade.py:180 inary/operations/install.py:76
#: inary/operations/upgrade.py:181
msgid "Total size of package(s): %.2f {}"
msgid "Total size of package(s): %.2f %s"
msgstr ""
#: inary/operations/downgrade.py:186 inary/operations/upgrade.py:187
......@@ -3290,6 +3288,10 @@ msgstr "Ucraniano"
msgid "Vietnamese"
msgstr "Vietnamita"
#: inary/system_literals/sysutils.py:117
msgid "Module: \"subprocess\" can not import"
msgstr ""
#: inary/uri.py:78
msgid "setAuthInfo needs a tuple (user, pass)"
msgstr ""
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment