chiark / gitweb /
common.get_wiki_timestamp() for posting timestamps to wiki log pages
authorHans-Christoph Steiner <hans@eds.org>
Wed, 17 Jan 2018 13:39:54 +0000 (14:39 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Mon, 22 Jan 2018 12:49:10 +0000 (13:49 +0100)
fdroidserver/build.py
fdroidserver/common.py

index 3b990e92a44a4a2fa02b76fa6017425f35993601..fab63200ed510b6a0eca3dbc85e27671ca2635c0 100644 (file)
@@ -290,10 +290,6 @@ def force_gradle_build_tools(build_dir, build_tools):
                                path)
 
 
-def _get_build_timestamp():
-    return time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime())
-
-
 def transform_first_char(string, method):
     """Uses method() on the first character of string."""
     if len(string) == 0:
@@ -1067,7 +1063,7 @@ def parse_commandline():
 options = None
 config = None
 buildserverid = None
-starttime = _get_build_timestamp()
+starttime = common.get_wiki_timestamp()
 
 
 def main():
@@ -1187,7 +1183,7 @@ def main():
 
         for build in app.builds:
             wikilog = None
-            build_starttime = _get_build_timestamp()
+            build_starttime = common.get_wiki_timestamp()
             tools_version_log = ''
             if not options.onserver:
                 tools_version_log = get_android_tools_version_log(build.ndk_path())
@@ -1284,7 +1280,7 @@ def main():
                     f.write('versionCode: %s\nversionName: %s\ncommit: %s\n' %
                             (build.versionCode, build.versionName, build.commit))
                     f.write('Build completed at '
-                            + _get_build_timestamp() + '\n')
+                            + common.get_wiki_timestamp() + '\n')
                     f.write('\n' + tools_version_log + '\n')
                     f.write(str(e))
                 logging.error("Could not build app %s: %s" % (appid, e))
@@ -1311,7 +1307,7 @@ def main():
                         fdroidserverid = fp.read().rstrip()
                     txt = "* build session started at " + starttime + '\n' \
                           + "* this build started at " + build_starttime + '\n' \
-                          + "* this build completed at " + _get_build_timestamp() + '\n' \
+                          + "* this build completed at " + common.get_wiki_timestamp() + '\n' \
                           + '* fdroidserverid: [https://gitlab.com/fdroid/fdroidserver/commit/' \
                           + fdroidserverid + ' ' + fdroidserverid + ']\n\n'
                     if buildserverid:
index 06d40faab5b1a870b7e44f155a1cc33e0081a54f..439a999162a425a5570def696e4325e9cbb82c6b 100644 (file)
@@ -3010,3 +3010,8 @@ def get_examples_dir():
         examplesdir = prefix + '/examples'
 
     return examplesdir
+
+
+def get_wiki_timestamp():
+    """Return current time in the standard format for posting to the wiki"""
+    return time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime())