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 xmlrpclib
|
||||
import subprocess
|
||||
import 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
|
||||
config=settings.load_settings()
|
||||
|
||||
try:
|
||||
subprocess.call(['stty', '-echo'])
|
||||
passwd = raw_input("Password for %s: " % (USER,))
|
||||
passwd = raw_input("Password for %s: " % (config['username'],))
|
||||
print
|
||||
finally:
|
||||
subprocess.call(['stty', 'echo'])
|
||||
|
||||
x = xmlrpclib.ServerProxy(XMLRPC_ENDPOINT)
|
||||
page = x.wp.getPage(BLOG_ID, PAGE_ID, USER, passwd)
|
||||
x = xmlrpclib.ServerProxy(config['xmlrpc_endpoint'])
|
||||
page = x.wp.getPage(config['blog_id'], config['participants_page_id'], config['username'], passwd)
|
||||
|
||||
text = render.render_template('templates/users.tmpl')
|
||||
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 a new issue