22
22
from PySide import QtGui, QtCore
24
from mountpoints.workflowstep import WorkflowStepMountPoint
25
from imagesourcestep.widgets.configuredialog import ConfigureDialog, ConfigureDialogState
24
from mapclient.mountpoints.workflowstep import WorkflowStepMountPoint
25
from mapclientplugins.imagesourcestep.widgets.configuredialog import ConfigureDialog, ConfigureDialogState
27
from core.threadcommandmanager import ThreadCommandManager, CommandCopyDirectory, CommandCloneWorkspace
28
from tools.pmr.pmrtool import PMRTool
29
from tools.pmr.pmrhglogindialog import PMRHgLoginDialog
27
from mapclient.core.threadcommandmanager import ThreadCommandManager, CommandCopyDirectory, CommandCloneWorkspace
28
from mapclient.tools.pmr.pmrtool import PMRTool
31
30
def getConfigFilename(identifier):
32
31
return identifier + '.conf'
71
70
self._configured = False
72
71
self._state = ConfigureDialogState()
73
72
self._threadCommandManager = ThreadCommandManager()
74
self._threadCommandManager.registerFinishedCallback(self._threadCommandsFinished)
73
# self._threadCommandManager.registerFinishedCallback(self._threadCommandsFinished)
76
75
def configure(self):
94
93
pmr_tool = PMRTool()
95
94
# Get login details:
96
dlg = PMRHgLoginDialog()
98
repourl = pmr_tool.addWorkspace(ImageSourceData.name + ': ' + self._state.identifier(), None)
99
c = CommandCloneWorkspace(repourl, step_location, dlg.username(), dlg.password())
100
self._threadCommandManager.addCommand(c)
101
self._state._pmrLocation = repourl
95
repourl = pmr_tool.addWorkspace(
96
ImageSourceData.name + ': ' + self._state.identifier(),
98
p = pmr_tool.requestTemporaryPassword(repourl)
101
c = CommandCloneWorkspace(repourl, step_location,
103
self._threadCommandManager.addCommand(c)
104
self._state._pmrLocation = repourl
103
107
elif self._state._pmrLocation:
109
if not os.path.exists(step_location):
110
os.mkdir(step_location)
112
repourl = self._state._pmrLocation
104
114
pmr_tool = PMRTool()
106
dlg = PMRHgLoginDialog()
108
if not os.path.exists(step_location):
109
os.mkdir(step_location)
110
c = CommandCloneWorkspace(self._state._pmrLocation, step_location, dlg.username(), dlg.password())
111
self._threadCommandManager.addCommand(c)
112
self._state._localLocation = step_location
115
p = pmr_tool.requestTemporaryPassword(repourl)
118
c = CommandCloneWorkspace(repourl, step_location,
120
self._threadCommandManager.addCommand(c)
121
self._state._localLocation = step_location