Example #1
0
 def submit_issue(self, title, description):
     # check credential
     try:
         parent = hildon.WindowStack.get_default().peek()
         dialog = hildon.LoginDialog(parent)
         dialog.set_message("Gmail account required")            
         response = dialog.run()
         username = dialog.get_username()
         password = dialog.get_password()
         dialog.destroy()
         if response == gtk.RESPONSE_OK:
             try:
                 issues_client = gdata.projecthosting.client.ProjectHostingClient()
                 issues_client.client_login(username, password,"zourite", "code")
                 versionInstance = version.getInstance()
                 versionStr = versionInstance.getVersion()
                 revisionStr = versionInstance.getRevision()
                 labels = ['Type-Defect', 'Priority-High', 'Version-' + versionStr, 'Revision-' + revisionStr]
                 issues_client.add_issue("zourite", title, description, "tbressure", labels=labels)
             except:                    
                 self.show_banner_information("failed to send issue")
                 logging.exception("Failed to report the previous issue due to")
             else:
                 self.show_banner_information("issue sent")
         else:
             self.show_banner_information("bug report cancelled")
     finally:
         hildon.WindowStack.get_default().pop_1()
Example #2
0
def runSetup(force=False):
    """
    This method should be run only if no plugin have been registered yet.
    This method try to load each plugin and mark them as registered e.g.
    to be load when zourite is instanciated.
    """
    print "Zourite " + version.getInstance().getVersion()
    print "--------------------"
    print "Interactive Plugin Configuration Boostrap"
    print ""

    AllPluginBootstrap().boot()  # inject all available plugin
    zcore = zourite.Zourite(auto_load=False)  # create an instance of the core
    zcore.applyDefaultSettings()
    for aPlugin in zourite.ZOURITE_AVAILABLE_PLUGIN:  # for each available plugin
        print ">>>", aPlugin.get_plugin_id(), "<<<"
        try:
            zcore.register_plugin(aPlugin)  # register the plugin
            if force:
                print "plugin configured, forced configuration..."
                configure(zcore, aPlugin)
            else:
                print "already configured !"
                print ""
        except plugin.ConfigurationRequiredExeption:
            print "not configured, starting configuration..."
            configure(zcore, aPlugin)

    print "saving configuration..."
    zcore.save_registered_plugin()  # save the current configuration of registered plugins
    print "configuration successful !!!"
Example #3
0
import hashlib
import httplib
import time
import urllib2
from xml.dom.minidom import parseString
import logging
import socket


import oauth as oauth

from zourite.common import version


version.getInstance().submitRevision("$Revision: 105 $")

class LinkedIn():
    LI_SERVER = "api.linkedin.com"
    LI_API_URL = "https://api.linkedin.com"

    REQUEST_TOKEN_URL = LI_API_URL + "/uas/oauth/requestToken"
    AUTHORIZE_URL = LI_API_URL + "/uas/oauth/authorize"
    ACCESS_TOKEN_URL = LI_API_URL + "/uas/oauth/accessToken"

    status_api = None
    connection_api = None
    network_api = None
    profile_api = None
    communication_api = None