Created
April 9, 2018 05:54
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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