summaryrefslogtreecommitdiff
path: root/update_pyparsing_timestamp.py
diff options
context:
space:
mode:
authorCengiz Kaygusuz <cngkaygusuz@gmail.com>2017-11-20 20:46:39 -0500
committerCengiz Kaygusuz <cngkaygusuz@gmail.com>2017-11-20 20:46:39 -0500
commit27e183a78c8062ed7c2bbb91655a5e56cd697bba (patch)
tree88fd355a0cc6da4c130582e092d702836596cbb2 /update_pyparsing_timestamp.py
parent4ba589cf13588e90992e23deb5a9784340efd2cc (diff)
downloadpyparsing-git-27e183a78c8062ed7c2bbb91655a5e56cd697bba.tar.gz
Move src to root
Diffstat (limited to 'update_pyparsing_timestamp.py')
-rw-r--r--update_pyparsing_timestamp.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/update_pyparsing_timestamp.py b/update_pyparsing_timestamp.py
new file mode 100644
index 0000000..80ea3d4
--- /dev/null
+++ b/update_pyparsing_timestamp.py
@@ -0,0 +1,17 @@
+from pyparsing import quotedString
+from datetime import datetime
+
+nw = datetime.utcnow()
+nowstring = '"%s"' % (nw.strftime("%d %b %Y %X")[:-3] + " UTC")
+print (nowstring)
+
+quoted_time = quotedString()
+quoted_time.setParseAction(lambda: nowstring)
+
+version_time = "__versionTime__ = " + quoted_time
+with open('pyparsing.py') as oldpp:
+ new_code = version_time.transformString(oldpp.read())
+
+with open('pyparsing.py','w') as newpp:
+ newpp.write(new_code)
+