sfjplib for python
Revisão | f6bf83ccbc242faf3fc6fcd7916144eaee220512 (tree) |
---|---|
Hora | 2011-08-25 20:46:40 |
Autor | Hiromichi MATSUSHIMA <hirom@offi...> |
Commiter | Hiromichi MATSUSHIMA |
add some files
@@ -0,0 +1,18 @@ | ||
1 | +# Copyright (c) 2011 hylom <hylomm at gmail.com> | |
2 | +# All rights reserved. | |
3 | +# | |
4 | +# This module is released under BSD License. | |
5 | +# http://www.opensource.org/licenses/bsd-license.php | |
6 | +# | |
7 | +"""sfjplib module | |
8 | + | |
9 | +libraries for SourceForge.JP | |
10 | +""" | |
11 | + | |
12 | +import sfjplib | |
13 | +from sfjplib import SfjpUser as SfjpUser | |
14 | +from sfjplib import docman2 as docman2 | |
15 | +from sfjplib import Wiki as Wiki | |
16 | + | |
17 | + | |
18 | +version = (0, 1, 1) |
@@ -0,0 +1,28 @@ | ||
1 | +#!/usr/bin/python | |
2 | +# -*- coding: utf-8 -*- | |
3 | +"""sfjplib.py""" | |
4 | + | |
5 | +import getpass | |
6 | +import sys | |
7 | +import codecs | |
8 | + | |
9 | +import sfjplib | |
10 | + | |
11 | +sys.stdout = codecs.getwriter("utf_8")(sys.stdout) | |
12 | + | |
13 | +if __name__ == "__main__": | |
14 | + #uname = raw_input("Username: ") | |
15 | + uname = "hiromichi-m" | |
16 | + passwd = getpass.getpass("Password: ") | |
17 | + u = sfjplib.SfjpUser(uname, passwd) | |
18 | + r = u.login() | |
19 | + d = sfjplib.Wiki(u) | |
20 | + uid = "test11" | |
21 | + name = "testpage" | |
22 | + (title, text, comment, postkey) = d.retrive_wikitext(uid, name) | |
23 | +# print title | |
24 | +# print text | |
25 | +# print comment | |
26 | + print postkey | |
27 | + d.post_wikitext(uid, name, u"ほげほげタイトル", u"ほげほげ本文", u"ほげほげコメント", postkey) | |
28 | + |