#!//usr/bin/env python2.7
+from __future__ import print_function
import subprocess
import re
import sys
import os
import ConfigParser
+try:
+ long
+except NameError:
+ long = int
+
distribution="yakkety"
versionTagRE = re.compile("^v([0-9]+((\.[0-9]+)+))(-(.+))?$")
version = upstreamVersion
else:
version = upstreamVersion + "~" + distribution + "1"
- print >> f, "nextcloud-client (%s) %s; urgency=medium" % (version, distribution)
- print >> f
- print >> f, " * " + subject
- print >> f
- print >> f, " -- %s <%s> %s" % (name, email, date)
- print >> f
+ print("nextcloud-client (%s) %s; urgency=medium" % (version, distribution), file=f)
+ print(file=f)
+ print(" * " + subject, file=f)
+ print(file=f)
+ print(" -- %s <%s> %s" % (name, email, date), file=f)
+ print(file=f)
return (latestBaseVersion, latestKind)
if __name__ == "__main__":
with open(sys.argv[1], "wt") as f:
(baseVersion, kind) = genChangeLogEntries(f, entries, distribution)
- print baseVersion, kind
+ print(baseVersion, kind)
# You should have received a copy of the GNU General Public License
# along with ownCloud. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import print_function
import os
import re
import subprocess
pass
if len(sys.argv) < 3:
- print 'Usage: %s <bundle.app> <path-to-qmake>' % sys.argv[0]
+ print('Usage: %s <bundle.app> <path-to-qmake>' % sys.argv[0])
exit()
def is_exe(fpath):
binaries = [i for i in glob(os.path.join(bundle_dir, 'Contents', 'MacOS', "*")) if is_exe(i)];
qt_version = QueryQMake('QT_VERSION')
-print "Using Qt", qt_version
+print("Using Qt", qt_version)
fixed_libraries = []
fixed_frameworks = []
def WriteQtConf():
- print "Writing qt.conf..."
+ print("Writing qt.conf...")
with open(os.path.join(resources_dir, 'qt.conf'), 'w') as f:
f.write("[Paths]\nPlugins = PlugIns\n");
f.close()
fixed_libraries.append(path)
abs_path = FindLibrary(path)
if abs_path == "":
- print "Could not resolve %s, not fixing!" % path
+ print("Could not resolve %s, not fixing!" % path)
return
broken_libs = GetBrokenLibraries(abs_path)
FixAllLibraries(broken_libs)
def CopyFramework(source_dylib):
parts = source_dylib.split(os.sep)
- print "CopyFramework:", source_dylib
+ print("CopyFramework:", source_dylib)
for i, part in enumerate(parts):
matchObj = re.match(r'(\w+\.framework)', part)
if matchObj:
commands.append(args)
if len(sys.argv) <= 2:
- print 'Will run %d commands:' % len(commands)
+ print('Will run %d commands:' % len(commands))
for command in commands:
- print ' '.join(command)
+ print(' '.join(command))
for command in commands:
p = subprocess.Popen(command)
import polib
from optparse import OptionParser
+try:
+ unicode
+except NameError:
+ unicode = str
+
parser = OptionParser()
parser.add_option("-o", "--output", dest="output",
help="Directory for localized output", default="../Shared/installer/nightly_localized.nsi")
if filename in localeToName:
language = localeToName[filename]
translationCache[language] = collections.OrderedDict()
-
+
po = polib.pofile(os.path.join(root,file))
for entry in po.translated_entries():
# Loop through all our labels and add translation (each translation may have multiple labels)
for label,value in translations.iteritems():
NSINewLines.append( tostr('StrCpy $%s "%s"\n' % (label,value)) )
if language.upper() == options.lang.upper():
- NSIDeclarations.append( tostr('Var %s\n' % label) )
+ NSIDeclarations.append( tostr('Var %s\n' % label) )
count += 1
NSIWorkingFile = open('%s/%s.nsh' % (options.output, language),"w")
NSIWorkingFile.writelines(NSINewLines)
NSIWorkingFile.close()
print ( "%i translations merged for language '%s'"%(count,language) )
-
+
# Finally, let's write languages.nsh and declarations.nsh
NSIWorkingFile = open('%s/languages.nsh' % options.output,"w")
NSIWorkingFile.writelines(NSILanguages)
NSIWorkingFile = open('%s/declarations.nsh' % options.output,"w")
NSIWorkingFile.writelines(NSIDeclarations)
NSIWorkingFile.close()
-
+
print ( "NSI Localization Operation Complete" )
state = entry['state']
state_ok = state.startswith('OK')
state_sync = state.startswith('SYNC')
+ isDir = os.path.isdir(filename + os.sep)
if state_ok:
shareable = True
elif state_sync and isDir: