Created
July 26, 2014 02:54
-
-
Save mygeekdaddy/d99685a333f1f4e47b2e to your computer and use it in GitHub Desktop.
startTimer.py script for WorkFlow process
This file contains hidden or 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
# startTimer.py - writes epoch time to text file for work log | |
# by: Jason Verly | |
# rev date: 2014-07-25 | |
import time | |
import console | |
import os | |
import os.path | |
import clipboard | |
import webbrowser | |
import urllib | |
if os.path.isfile('timer.txt'): | |
console.clear() | |
console.hud_alert('File exists', 'error') | |
webbrowser.open('drafts://') | |
else: | |
console.clear() | |
curDate = time.time() | |
f = open('timer.txt', 'w') | |
f.write(str(curDate)) | |
f.close() | |
console.hud_alert('Timer started','success') | |
worklogtext = clipboard.get() | |
encodetxt = urllib.quote(worklogtext, safe='') | |
draft_url = 'drafts://x-callback-url/create?text=' | |
action = '&action%3DWorkLog_Entry&afterSuccess%3DDelete' | |
webbrowser.open(draft_url + encodetxt + action) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment