def __init__(self, path): """Create a project associated with a given path""" # To create a Project, a path is required self.name = path self.shortName = os.path.basename(path) self.path = os.path.abspath(path) self._isLink = os.path.islink(path) self.pathList = [] # Store all related paths self.dbPath = self.__addPath(PROJECT_DBNAME) self.logsPath = self.__addPath(PROJECT_LOGS) self.runsPath = self.__addPath(PROJECT_RUNS) self.tmpPath = self.__addPath(PROJECT_TMP) self.uploadPath = self.__addPath(PROJECT_UPLOAD) self.settingsPath = self.__addPath(PROJECT_SETTINGS) self.configPath = self.__addPath(PROJECT_CONFIG) self.runs = None self._runsGraph = None self._transformGraph = None self._sourceGraph = None self.address = '' self.port = pwutils.getFreePort() self.mapper = None self.settings = None # Host configuration self._hosts = None self._protocolViews = None # Creation time should be stored in project.sqlite when the project # is created and then loaded with other properties from the database self._creationTime = None # Time stamp with the last run has been updated self._lastRunTime = None
def __init__(self, path): """Create a project associated with a given path""" # To create a Project, a path is required self.name = path self.shortName = os.path.basename(path) self.path = os.path.abspath(path) self.pathList = [] # Store all related paths self.dbPath = self.__addPath(PROJECT_DBNAME) self.logsPath = self.__addPath(PROJECT_LOGS) self.runsPath = self.__addPath(PROJECT_RUNS) self.tmpPath = self.__addPath(PROJECT_TMP) self.uploadPath = self.__addPath(PROJECT_UPLOAD) self.settingsPath = self.__addPath(PROJECT_SETTINGS) self.configPath = self.__addPath(PROJECT_CONFIG) self.runs = None self._runsGraph = None self._transformGraph = None self._sourceGraph = None self.address = '' self.port = pwutils.getFreePort() self.mapper = None self.settings = None # Host configuration self._hosts = None self._protocolViews = None
def __init__(self, volfile, sendEnd=True, **kwargs): if volfile.endswith('.mrc'): volfile += ':mrc' self.kwargs = kwargs if volfile is None: raise ValueError(volfile) if '@' in volfile: [index, file] = volfile.split('@') else: file = volfile if ':' in file: file = file[0:file.rfind(':')] if not os.path.exists(file): raise Exception("File %s does not exists" % file) self.volfile = volfile self.voxelSize = self.kwargs.get('voxelSize', None) # ChimeraServer is the basic server. There are other # than inherit from it. serverName = self.kwargs.get('ChimeraServer', 'ChimeraServer') self.address = '' self.port = getFreePort() serverfile = pw.join('em', 'chimera_server.py') command = CommandView( "chimera --script '%s %s %s' &" % (serverfile, self.port, serverName), env=getChimeraEnviron(), ).show() self.authkey = 'test' self.client = Client((self.address, self.port), authkey=self.authkey) self.initVolumeData() self.openVolumeOnServer(self.vol, sendEnd) self.initListenThread()
def __init__(self, volfile, sendEnd=True,**kwargs): if volfile.endswith('.mrc'): volfile += ':mrc' self.kwargs = kwargs if volfile is None: raise ValueError(volfile) if '@' in volfile: [index, file] = volfile.split('@'); else : file = volfile if ':' in file: file = file[0: file.rfind(':')] if not os.path.exists(file): raise Exception("File %s does not exists"%file) self.volfile = volfile self.voxelSize = self.kwargs.get('voxelSize', None) # ChimeraServer is the basic server. There are other # than inherit from it. serverName=self.kwargs.get('ChimeraServer','ChimeraServer') self.address = '' self.port = getFreePort() serverfile = os.path.join(os.environ['SCIPION_HOME'], 'pyworkflow', 'em', 'chimera_server.py') command = CommandView("chimera --script '%s %s %s' &" % (serverfile, self.port,serverName), env=getChimeraEnviron(),).show() self.authkey = 'test' self.client = Client((self.address, self.port), authkey=self.authkey) self.initVolumeData() self.openVolumeOnServer(self.vol,sendEnd) self.initListenThread()
def __init__(self, volfile, sendEnd=True, **kwargs): if volfile.endswith(".mrc"): volfile += ":mrc" self.kwargs = kwargs if volfile is None: raise ValueError(volfile) if "@" in volfile: [index, file] = volfile.split("@") else: file = volfile if ":" in file: file = file[0 : file.rfind(":")] if not os.path.exists(file): raise Exception("File %s does not exists" % file) self.volfile = volfile self.voxelSize = self.kwargs.get("voxelSize", None) # ChimeraServer is the basic server. There are other # than inherit from it. serverName = self.kwargs.get("ChimeraServer", "ChimeraServer") self.address = "" self.port = getFreePort() serverfile = os.path.join(os.environ["SCIPION_HOME"], "pyworkflow", "em", "chimera_server.py") command = CommandView( "chimera --script '%s %s %s' &" % (serverfile, self.port, serverName), env=getChimeraEnviron() ).show() self.authkey = "test" self.client = Client((self.address, self.port), authkey=self.authkey) self.initVolumeData() self.openVolumeOnServer(self.vol, sendEnd) self.initListenThread()
def initProtocolTCPServer(protocol): address = '' port = getFreePort() server = MySocketServer((address, port), ProtocolTCPRequestHandler) server.protocol = protocol server_thread = threading.Thread(target=server.serve_forever) server_thread.start() return port
def __init__(self, dataview, vol, viewParams={}, **kwargs): #print 'on pair' self.dataview = dataview self.showjPort = getFreePort() self.dataview._viewParams[showj.CHIMERA_PORT] = self.showjPort self.dataview._viewParams[showj.MODE] = showj.MODE_MD self.dataview._viewParams[showj.INVERTY] = '' ChimeraClientView.__init__(self, vol.getFileName(), showProjection=True, showjPort=self.showjPort, voxelSize=vol.getSamplingRate())
def initProtocolTCPServer(protocol): address = '' port = getFreePort() server = MySocketServer((address, port), ProtocolTCPRequestHandler) server.protocol = protocol server_thread = threading.Thread(target=server.serve_forever) server_thread.daemon = True server_thread.start() return port
def __init__(self, dataview, vol, viewParams={}, **kwargs): self.dataview = dataview self.showjPort = getFreePort() self.dataview._viewParams[showj.CHIMERA_PORT] = self.showjPort self.dataview._viewParams[showj.MODE] = showj.MODE_MD self.dataview._viewParams[showj.INVERTY] = '' ChimeraClientView.__init__(self, vol.getFileName(), showProjection=True, showjPort=self.showjPort, voxelSize=vol.getSamplingRate())