diff options
Diffstat (limited to 'trunk/src/update_pyparsing_timestamp.py')
-rw-r--r-- | trunk/src/update_pyparsing_timestamp.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/trunk/src/update_pyparsing_timestamp.py b/trunk/src/update_pyparsing_timestamp.py new file mode 100644 index 0000000..80ea3d4 --- /dev/null +++ b/trunk/src/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)
+
|