From: Ian Kelling Date: Tue, 4 Feb 2020 00:37:24 +0000 (-0500) Subject: add photo posting X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=HEAD;p=jan-pona-mute.git add photo posting --- 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.")