def do_post(self, line):
"""Write a post on the current stream.
+Preface with -p PATH_WITH_NO_SPACES to post a photo.
If you just use a number as your post, it will refer to a note.
Use the 'edit' command to edit notes."""
if line == "":
if line in notes:
print("Using note '%s'" % line)
line = self.read_note(line)
- self.post = self.home.post(text = line)
+ linesplit = line.split(' ', 2)
+ if (len(linesplit) == 3 and linesplit[0] == '-p'):
+ self.post = self.home.post(photo = linesplit[1], text = linesplit[2])
+ else:
+ self.post = self.home.post(text = line)
self.post_cache[self.post.id] = self.post
self.undo.append("delete post %s" % self.post.id)
print("Posted. Use the 'show' command to show it. Use the 'undo' command to undo this.")