removed in-script settings, added settings reader
This commit is contained in:
parent
887b62137f
commit
43779d1efb
|
@ -5,24 +5,21 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import xmlrpclib
|
import xmlrpclib
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import settings
|
||||||
|
|
||||||
|
config=settings.load_settings()
|
||||||
XMLRPC_ENDPOINT = 'http://blog-URL.tld/xmlrpc.php' # Wordpress RPC-URL - e.g. http://chaosblog.wordpress.com/xmlrpc.php
|
|
||||||
USER = 'username' # wordpress-username
|
|
||||||
BLOG_ID = 0
|
|
||||||
PAGE_ID = 12
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.call(['stty', '-echo'])
|
subprocess.call(['stty', '-echo'])
|
||||||
passwd = raw_input("Password for %s: " % (USER,))
|
passwd = raw_input("Password for %s: " % (config['username'],))
|
||||||
print
|
print
|
||||||
finally:
|
finally:
|
||||||
subprocess.call(['stty', 'echo'])
|
subprocess.call(['stty', 'echo'])
|
||||||
|
|
||||||
x = xmlrpclib.ServerProxy(XMLRPC_ENDPOINT)
|
x = xmlrpclib.ServerProxy(config['xmlrpc_endpoint'])
|
||||||
page = x.wp.getPage(BLOG_ID, PAGE_ID, USER, passwd)
|
page = x.wp.getPage(config['blog_id'], config['participants_page_id'], config['username'], passwd)
|
||||||
|
|
||||||
text = render.render_template('templates/users.tmpl')
|
text = render.render_template('templates/users.tmpl')
|
||||||
page['description'] = text
|
page['description'] = text
|
||||||
|
|
||||||
x.wp.editPage(BLOG_ID, PAGE_ID, USER, passwd, page, True)
|
x.wp.editPage(config['blog_id'], config['participants_page_id'], config['username'], passwd,page,True)
|
Loading…
Reference in New Issue