From da29d7e0b57848e5fe957a0db78d01fbf64e4c43 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 3 Feb 2020 19:37:24 -0500 Subject: [PATCH] add photo posting --- jan-pona-mute.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jan-pona-mute.py b/jan-pona-mute.py index 7f06c90..a7fc456 100755 --- a/jan-pona-mute.py +++ b/jan-pona-mute.py @@ -510,6 +510,7 @@ Use the 'edit' command to edit notes.""" 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 == "": @@ -522,7 +523,11 @@ Use the 'edit' command to edit notes.""" 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.") -- 2.25.1