Skip to content

Instantly share code, notes, and snippets.

@maphew
Created April 9, 2018 05:54
Show Gist options
  • Save maphew/fdc2f284386cd45674b226c97f41c2b7 to your computer and use it in GitHub Desktop.
Save maphew/fdc2f284386cd45674b226c97f41c2b7 to your computer and use it in GitHub Desktop.
get_timestamp_from_commit_json(), was part of Leo-Editor setup.py troubleshooting
## was part of Leo-Editor setup.py troubleshooting
try:
import semantic_version
except ImportError:
print('*** Warning: failed to import `semantic_version`')
get_timestamp_from_commit_json()
def get_timestamp_from_commit_json(file):
import json
root = os.path.dirname(os.path.realpath(file))
json_file = os.path.join(root, 'leo/core/commit_timestamp.json')
with open(json_file) as json_data:
d = json.load(json_data)
return d['timestamp']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment