Hi Philip/Timur
Launchpadlib allows to load credentials from a file, run the script before on your machine, it will open a browser and once you authorise it will generate some access_token/access_secret keys, then all you need is to upload the file to the server :
[1] consumer_key = System-wide: Ubuntu (xxxx) consumer_secret = access_token = xxxxxxxxxxxxxxxxxxxxxxx access_secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
diff
--- jira_sync.py 2013-11-30 22:36:01.922959795 +0000 +++ jira.py 2013-11-30 22:35:15.126960992 +0000 @@ -20,6 +20,7 @@ from dateutil import parser from jira.client import JIRA from launchpadlib.launchpad import Launchpad +from launchpadlib.uris import LPNET_SERVICE_ROOT
httplib2.debuglevel = 0 @@ -134,7 +135,15 @@
def get_launchpad_bugs(project): project = project.lower() - launchpad = Launchpad.login_with(project, 'production') + cachedir = 'cache' + credentials_filename = "credentials.txt" + launchpad = Launchpad.login_with( + u'YOUR APP', + service_root=LPNET_SERVICE_ROOT, + credentials_file=credentials_filename, + launchpadlib_dir=cachedir + ) + project = launchpad.projects[project] launchpad_bugs = project.searchTasks(status=["New", "Fix Committed", "Invalid", "Won't Fix", @@ -380,4 +389,5 @@ user=config.get('JIRA', 'user'), password=config.get('JIRA', 'password'), project=config.get('project', 'name'), - project_key=config.get('JIRA', 'project_key')) \ Pas de fin de ligne à la fin du fichier + project_key=config.get('JIRA', 'project_key')) +
Hi Philip/Timur
Launchpadlib allows to load credentials from a file, run the script before on your machine, it will open a browser and once you authorise it will generate some access_ token/access_ secret keys, then all you need is to upload the file to the server :
[1] xxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxx
consumer_key = System-wide: Ubuntu (xxxx)
consumer_secret =
access_token = xxxxxxxxxxxxxxx
access_secret = xxxxxxxxxxxxxxx
diff
--- jira_sync.py 2013-11-30 22:36:01.922959795 +0000 launchpad import Launchpad
+++ jira.py 2013-11-30 22:35:15.126960992 +0000
@@ -20,6 +20,7 @@
from dateutil import parser
from jira.client import JIRA
from launchpadlib.
+from launchpadlib.uris import LPNET_SERVICE_ROOT
httplib2. debuglevel = 0
@@ -134,7 +135,15 @@
def get_launchpad_ bugs(project) : login_with( project, 'production') filename = "credentials.txt" login_with( root=LPNET_ SERVICE_ ROOT, file=credential s_filename, dir=cachedir projects[ project] searchTasks( status= ["New", "Fix Committed",
"Invalid" , "Won't Fix",
user= config. get('JIRA' , 'user'),
password= config. get('JIRA' , 'password'),
project= config. get('project' , 'name'), key=config. get('JIRA' , 'project_key')) key=config. get('JIRA' , 'project_key'))
project = project.lower()
- launchpad = Launchpad.
+ cachedir = 'cache'
+ credentials_
+ launchpad = Launchpad.
+ u'YOUR APP',
+ service_
+ credentials_
+ launchpadlib_
+ )
+
project = launchpad.
launchpad_bugs = project.
@@ -380,4 +389,5 @@
- project_
\ Pas de fin de ligne à la fin du fichier
+ project_
+