diff --git a/gchange-profile.py b/gchange-profile.py index 1fa78da..e66c4a3 100755 --- a/gchange-profile.py +++ b/gchange-profile.py @@ -45,7 +45,7 @@ args = parser.parse_args() if sys.argv[1] == "like": if args.stars or args.stars == 0: gchange = SendLikes(dunikey, pod) - gchange.like(args.profile, args.stars) + gchange.like(args.stars, args.profile) else: gchange = ReadLikes(dunikey, pod) gchange.readLikes(args.profile) diff --git a/lib/gchange.py b/lib/gchange.py index ff821eb..04e0984 100644 --- a/lib/gchange.py +++ b/lib/gchange.py @@ -127,6 +127,7 @@ class SendLikes: # Configure JSON document to send def configDoc(self, profile, likes): + if not profile: profile = self.issuer if likes not in range(0, 6): sys.stderr.write(colored('Votre like doit ĂȘtre compris entre 0 et 5.\n', 'red')) return False @@ -191,7 +192,7 @@ class SendLikes: - def like(self, profile, stars): + def like(self, stars, profile=False): document = self.configDoc(profile, stars) if document: self.sendDocument(document, profile)