/usr/lib/python2.7/dist-packages/gnomeblog/advogato.py is in gnome-blog 0.9.1-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | import xmlrpclib
from gtk import TRUE, FALSE
import gettext
_ = gettext.gettext
from gnomeblog import hig_alert
from gnomeblog import proxy
appkey = "6BF507937414229AEB450AB075001667C8BC8338"
class Blog:
def __init__(self):
pass
def postEntry (self, username, password, url, title, entry, client, gconf_prefix):
#check for GNOME proxy configurations and use if required
proxy_transport = proxy.GnomeProxyTransport(client)
server = proxy_transport.get_server(url);
try:
cookie = server.authenticate(username, password)
except xmlrpclib.Fault, e:
if (server.user.exists (username) == 0):
hig_alert.reportError(_("Could not post Blog entry"), _("Your username is invalid. Please double-check the preferences."))
return FALSE
else:
hig_alert.reportError(_("Could not post Blog entry"), _("Your username or password is invalid. Please double-check the preferences."))
return FALSE
success = TRUE
try:
server.diary.set(cookie, -1, entry)
except xmlrpclib.Fault, e:
hig_alert.handleBloggerAPIFault(e, _("Could not post blog entry"), username, blog_id, url)
success = FALSE
except xmlrpclib.ProtocolError, e:
hig_alert.reportError(_("Could not post Blog entry"), _('URL \'%s\' does not seem to be a valid bloggerAPI XML-RPC server. Web server reported: %s.') % (url, hig_alert.italic(e.errmsg)))
success = FALSE
print ("Success is....")
print (success)
return success
blog = Blog()
|