~sara.ribeiro/gtg/userdoc

« back to all changes in this revision

Viewing changes to GTG/backends/backend_launchpad.py

  • Committer: Sara Ribeiro
  • Date: 2014-03-09 09:52:02 UTC
  • mfrom: (1360.2.3 trunk2)
  • Revision ID: sara.rmgr@gmail.com-20140309095202-o8ajab32rxl6wr50
Solve merge conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import uuid
27
27
import datetime
28
28
from xdg.BaseDirectory import xdg_cache_home
29
 
from launchpadlib.launchpad import Launchpad, \
30
 
    STAGING_SERVICE_ROOT, \
31
 
    EDGE_SERVICE_ROOT
 
29
from launchpadlib.launchpad import Launchpad, EDGE_SERVICE_ROOT
32
30
 
33
31
from GTG.core.task import Task
34
 
from GTG.tools.testingmode import TestingMode
35
32
from GTG import _
36
33
from GTG.backends.genericbackend import GenericBackend
37
34
from GTG.backends.backendsignals import BackendSignals
122
119
        # Connecting to Launchpad
123
120
        CACHE_DIR = os.path.join(xdg_cache_home, 'gtg/backends/',
124
121
                                 self.get_id())
125
 
        if TestingMode().get_testing_mode():
126
 
            SERVICE_ROOT = STAGING_SERVICE_ROOT
127
 
        else:
128
 
            SERVICE_ROOT = EDGE_SERVICE_ROOT
129
122
        try:
130
123
            self.cancellation_point()
131
 
            self.launchpad = Launchpad.login_anonymously(GTG_NAME,
132
 
                                                         SERVICE_ROOT,
133
 
                                                         CACHE_DIR)
 
124
            self.launchpad = Launchpad.login_anonymously(
 
125
                GTG_NAME, EDGE_SERVICE_ROOT, CACHE_DIR)
134
126
        except:
135
127
            # The connection is not working (the exception type can be
136
128
            # anything)
211
203
                tid = str(uuid.uuid4())
212
204
                task = self.datastore.task_factory(tid)
213
205
                self._populate_task(task, bug_dic)
214
 
                self.sync_engine.record_relationship(local_id=tid,
215
 
                                                     remote_id=str(
216
 
                                                     bug_dic['self_link']),
217
 
                                                     meme=SyncMeme(
218
 
                                                     task.get_modified(),
219
 
                                                     bug_dic['modified'],
220
 
                                                     self.get_id()))
 
206
                meme = SyncMeme(
 
207
                    task.get_modified(), bug_dic['modified'], self.get_id())
 
208
                self.sync_engine.record_relationship(
 
209
                    local_id=tid,
 
210
                    remote_id=str(bug_dic['self_link']),
 
211
                    meme=meme,
 
212
                )
221
213
                self.datastore.push_task(task)
222
214
 
223
215
            elif action == SyncEngine.UPDATE: