support for today
added today to plist fixing due date name in plist
This commit is contained in:
parent
cb1d43e82a
commit
c009a3176a
@ -23,8 +23,15 @@ class Project(ToDo):
|
||||
|
||||
def makeAppleScript(self):
|
||||
ans = "\n"
|
||||
ans += "\n"
|
||||
|
||||
ans += "set " + self.getMD5() + " to make new project \n"
|
||||
|
||||
ans += "set " + self.getMD5() + " to make new project "
|
||||
|
||||
if self.isToDay():
|
||||
ans += "at beginning of list \"Today\""
|
||||
|
||||
ans += "\n"
|
||||
|
||||
ans += "set name of " + self.getMD5() + " to \"" + self.getName() + "\"\n"
|
||||
|
||||
@ -35,7 +42,7 @@ class Project(ToDo):
|
||||
ans += "set notes of " + self.getMD5() + " to \"" + self.getNotes() + "\"\n"
|
||||
|
||||
if self.getDueDate() > 0:
|
||||
ans += "set due date of " + self.getMD5() + " to (current date) + " + self.getDueDate() + " * days\n"
|
||||
ans += "set due date of " + self.getMD5() + " to (current date) + " + str(self.getDueDate()) + " * days\n"
|
||||
|
||||
tags = ""
|
||||
for tag in self.getTags():
|
||||
|
||||
@ -25,6 +25,11 @@ class ToDo:
|
||||
return 0
|
||||
return self.plist["due date"]
|
||||
|
||||
def isToDay(self):
|
||||
if "today" not in self.plist:
|
||||
return False
|
||||
return self.plist["today"]
|
||||
|
||||
def getMD5(self):
|
||||
return self.md5
|
||||
|
||||
@ -33,8 +38,14 @@ class ToDo:
|
||||
|
||||
def makeAppleScript(self):
|
||||
ans = "\n"
|
||||
ans += "\n"
|
||||
|
||||
ans += "set " + self.getMD5() +" to make new to do \n"
|
||||
ans += "set " + self.getMD5() +" to make new to do "
|
||||
|
||||
if self.isToDay():
|
||||
ans += "at beginning of list \"Today\""
|
||||
|
||||
ans += "\n"
|
||||
|
||||
ans += "set name of " + self.getMD5() + " to \""+ self.getName() +"\"\n"
|
||||
|
||||
|
||||
@ -9,6 +9,8 @@
|
||||
<string>sample todos0</string>
|
||||
<key>due date</key>
|
||||
<integer>5</integer>
|
||||
<key>today</key>
|
||||
<true/>
|
||||
<key>tags</key>
|
||||
<array>
|
||||
<string>sampleTag4</string>
|
||||
@ -35,6 +37,8 @@ Phasellus fringilla est sed congue mollis. Nullam cursus aliquam arcu quis tinci
|
||||
Duis at congue nisl. In pharetra vitae nibh at finibus. Aenean ullamcorper purus a ultrices consectetur. Duis sed ultricies sapien, pulvinar vestibulum libero. Donec id neque nec mi eleifend blandit at id libero. Nullam scelerisque massa quis ultrices tincidunt. Aenean condimentum rhoncus fringilla.</string>
|
||||
<key>due date</key>
|
||||
<integer>3</integer>
|
||||
<key>today</key>
|
||||
<true/>
|
||||
<key>tags</key>
|
||||
<array>
|
||||
<string>sampleTag1</string>
|
||||
@ -49,6 +53,8 @@ Duis at congue nisl. In pharetra vitae nibh at finibus. Aenean ullamcorper purus
|
||||
<string>sample todos1</string>
|
||||
<key>due date</key>
|
||||
<integer>0</integer>
|
||||
<key>today</key>
|
||||
<true/>
|
||||
<key>tags</key>
|
||||
<array>
|
||||
<string>sampleTag3</string>
|
||||
@ -62,6 +68,8 @@ Duis at congue nisl. In pharetra vitae nibh at finibus. Aenean ullamcorper purus
|
||||
<string>sample todos2</string>
|
||||
<key>due date</key>
|
||||
<integer>0</integer>
|
||||
<key>today</key>
|
||||
<false/>
|
||||
<key>tags</key>
|
||||
<array>
|
||||
<string>sampleTag2</string>
|
||||
@ -75,6 +83,8 @@ Duis at congue nisl. In pharetra vitae nibh at finibus. Aenean ullamcorper purus
|
||||
<string>sample todos3</string>
|
||||
<key>due date</key>
|
||||
<integer>0</integer>
|
||||
<key>today</key>
|
||||
<false/>
|
||||
<key>tags</key>
|
||||
<array>
|
||||
<string>sampleTag3</string>
|
||||
|
||||
@ -63,6 +63,8 @@ class thingspy:
|
||||
cmd.append("-e")
|
||||
cmd.append(applescript)
|
||||
|
||||
# print applescript
|
||||
|
||||
process = Popen(cmd, stdout=PIPE)
|
||||
out, err = process.communicate()
|
||||
print("out:" + str(out))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user