Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P3256
scripts/flow_thanks.py - v1.0
Active
Public
Actions
Authored by
darthbhyrava
on Jun 16 2016, 4:29 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
Pywikibot-Thanks
Pywikibot-Flow
Referenced Files
F4170588: scripts/flow_thanks.py - v1.0
Jun 16 2016, 4:29 AM
2016-06-16 04:29:13 (UTC+0)
Subscribers
None
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
A script which takes a post ID on a Flow Board and thanks it on behalf of the
user logged in.
Syntax: python pwb.py thanks -flow_post:[post_id]
@params;
-flow_post: The value of the postID to be thanked.
"""
from
__future__
import
absolute_import
,
unicode_literals
import
pywikibot
def
thank_flow_post
(
post_id
):
"""
Thank the given Post ID on a Flow Board on behalf of the user logged in.
"""
#Login into the side
site
=
pywikibot
.
Site
()
site
.
login
()
#Make Thank API call to site, and print result
result
=
site
.
thank_flowpost
(
post_id
)
print
result
def
main
(
*
args
):
"""
Proces command line arguments and thank the post
"""
local_args
=
pywikibot
.
handle_args
(
args
)
for
arg
in
local_args
:
option
,
sep
,
value
=
arg
.
partition
(
':'
)
if
option
==
'-flow_post'
:
post_id
=
value
thank_flow_post
(
post_id
)
if
__name__
==
"__main__"
:
main
()
Event Timeline
darthbhyrava
created this paste.
Jun 16 2016, 4:29 AM
2016-06-16 04:29:13 (UTC+0)
darthbhyrava
mentioned this in
T137836: GSoC: Pywikibot-Thanks | Meeting 6 | 15th June
.
Jun 16 2016, 4:33 AM
2016-06-16 04:33:42 (UTC+0)
darthbhyrava
mentioned this in
T138056: GSoC: Pywikibot-Thanks | Meeting 7 | 17th June
.
Jun 17 2016, 3:51 PM
2016-06-17 15:51:18 (UTC+0)
darthbhyrava
mentioned this in
T133667: Weekly Reports for Pywikibot Support for Thanks
.
Jun 23 2016, 10:54 PM
2016-06-23 22:54:30 (UTC+0)
Log In to Comment