当前位置: 首页>>代码示例>>Python>>正文


Python LDSUtilities.standardiseDriverNames方法代码示例

本文整理汇总了Python中lds.LDSUtilities.LDSUtilities.standardiseDriverNames方法的典型用法代码示例。如果您正苦于以下问题:Python LDSUtilities.standardiseDriverNames方法的具体用法?Python LDSUtilities.standardiseDriverNames怎么用?Python LDSUtilities.standardiseDriverNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lds.LDSUtilities.LDSUtilities的用法示例。


在下文中一共展示了LDSUtilities.standardiseDriverNames方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _deregister

# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseDriverNames [as 别名]
 def _deregister(self,name):
     fn = LU.standardiseDriverNames(name)
     #sync/rel the DS
     #self.register[fn]['ep'].closeDS()#DS should already have closed
     self.register[fn]['ep'] = None
     self.register[fn]['type'] = None
     self.register[fn]['uri'] = None
     del self.register[fn]
开发者ID:linz,项目名称:lds_replicate,代码行数:10,代码来源:ConfigConnector.py

示例2: _initSection

# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseDriverNames [as 别名]
 def _initSection(self,section):
     checksec = LU.standardiseDriverNames(section)
     if checksec:
         self.cp.add_section(checksec)
         return True
     elif section == self.PREFS_SEC:
         self.cp.add_section(section)
         return True
     return False
开发者ID:josephramsay,项目名称:LDS,代码行数:11,代码来源:ReadConfig.py

示例3: closeEndPoint

# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseDriverNames [as 别名]
 def closeEndPoint(self,name):
     '''Closes the DS is a named EP or delete the EP completely if not needed'''
     fn = LU.standardiseDriverNames(name)
     #<HACK6>. Bypass DS closing for FileGDB connections
     if fn=='FileGDB': return
     #</HACK6>
     if self.register.has_key(fn):
         self._disconnect(fn)
         if self.register[fn]['rc'] == 0:
             self._deregister(fn)
开发者ID:linz,项目名称:lds_replicate,代码行数:12,代码来源:ConfigConnector.py

示例4: runReplicationScript

# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseDriverNames [as 别名]
    def runReplicationScript(self,clean=False):
        '''Run the layer/group repliction script'''
        destination,lgval,uconf,epsg,fe,te,fd,td = self.readParameters()
        uconf_path = LU.standardiseUserConfigName(uconf)
        destination_path = LU.standardiseLayerConfigName(destination)
        destination_driver = LU.standardiseDriverNames(destination)

        if not os.path.exists(uconf_path):
            self.userConfMessage(uconf_path)
            return
        elif not MainFileReader(uconf_path).hasSection(destination_driver):
            self.userConfMessage(uconf_path,destination_driver)
            return
        #-----------------------------------------------------
        #'destname','layer','uconf','group','epsg','fd','td','int'
     
        self.parent.gpr.write((destination_driver,lgval,uconf,epsg,fd,td))        
        ldslog.info(u'dest={0}, lg={1}, conf={2}, epsg={3}'.format(destination_driver,lgval,uconf,epsg))
        ldslog.info('fd={0}, td={1}, fe={2}, te={3}'.format(fd,td,fe,te))
        lgindex = self.parent.confconn.getLayerGroupIndex(lgval,col=1)
        #lorg = self.parent.confconn.lglist[lgindex][0]
        #----------don't need lorg in TP anymore but it is useful for sorting/counting groups
        #self.parent.confconn.tp.setLayerOrGroup(lorg)
        self.parent.confconn.tp.setLayerGroupValue(lgval)
        if self.fromdateenable.isChecked(): self.parent.confconn.tp.setFromDate(fd)
        if self.todateenable.isChecked(): self.parent.confconn.tp.setToDate(td)
        self.parent.confconn.tp.setUserConf(uconf)
        if self.epsgenable: self.parent.confconn.tp.setEPSG(epsg)
        
        #because clean state persists in TP
        if clean:
            self.parent.confconn.tp.setCleanConfig()
        else:
            self.parent.confconn.tp.clearCleanConfig()
        #(re)initialise the data source since uconf may have changed
        #>>#self.parent.confconn.tp.src = self.parent.confconn.initSourceWrapper()
        #--------------------------
        ###ep = self.parent.confconn.reg.openEndPoint(self.parent.confconn.destname,self.parent.confconn.uconf)
        
        ###self.parent.confconn.reg.closeEndPoint(self.parent.confconn.destname)
        ###ep = None
        #Open ProcessRunner and run with TP(proc)/self(gui) instances
        #HACK temp add of dest_drv to PR call
        try:
            #TODO. Test for valid LC first
            self.tpr = ProcessRunner(self,destination_driver)
        except Exception as e:
            ldslog.error('Cannot create ProcessRunner {}. NB Possible missing Layer Config {}'.format(str(e),destination_path))
            self.layerConfMessage(destination_path)
            return
        #If PR has been successfully created we must vave a valid dst    
        ldslog.debug('TRPstart')
        self.tpr.start()
开发者ID:linz,项目名称:lds_replicate,代码行数:55,代码来源:LDSGUI.py

示例5: openEndPoint

# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseDriverNames [as 别名]
 def openEndPoint(self,name,uri=None,req=None):
     #print 'GEP',name,uri,req
     '''Gets a named EP incrementing a refcount or registers a new one as needed'''
     fn = LU.standardiseDriverNames(name)
     #if fn+uri exist AND fn is valid AND (fn not prev registered OR the saved URI != uri) 
     if (fn and uri)\
     and (fn in DataStore.DRIVER_NAMES.values() or fn == WFSDataStore.DRIVER_NAME) \
     and (not self.register.has_key(fn) or self.register[fn]['uri']!=uri):
         self._register(fn,uri)
         self._connect(fn, req)
     elif fn in self.register: 
         self._connect(fn,req)
     else:
         raise EndpointConnectionException('Register Entry {} has not been initialised.'.format(fn))
     return self.register[fn]['ep']
开发者ID:linz,项目名称:lds_replicate,代码行数:17,代码来源:ConfigConnector.py

示例6: len

# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseDriverNames [as 别名]
    if len(args)==0:
        print __doc__
        sys.exit(0)
    else: 
        #since we're not breaking the switch the last arg read will be the DST used
        pn = None
        for arg in args:
            if arg.lower() in ("init", "initialise", "initalize"):
                ldslog.info("Initialisation of configuration files/tables requested. Implies FULL rebuild")
                tp.setInitConfig()
            elif arg in ("clean"):
                ldslog.info("Cleaning named layer")
                tp.setCleanConfig()
            else:
                #if we dont have init/clean the only other arg must be output type
                pn = LDSUtilities.standardiseDriverNames(arg)
                
        if pn is None:
            print __doc__
            raise InputMisconfigurationException("Unrecognised command; output type (pg,ms,slite,fgdb) declaration required")
            

    #aggregation point for common LDS errors
    mm = '*** Complete *** '
    try:
        reg = DatasourceRegister()
        sep = reg.openEndPoint('WFS',uc)
        dep = reg.openEndPoint(pn,uc)
        reg.setupLayerConfig(tp,sep,dep, tp.getInitConfig())
        tp.setSRC(sep)
        tp.setDST(dep)
开发者ID:josephramsay,项目名称:LDS,代码行数:33,代码来源:ldsreplicate.py

示例7: updateGUIValues

# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseDriverNames [as 别名]
 def updateGUIValues(self,readlist):
     '''Fill dialog values from provided list'''
     #TODO. Remove circular references when setCurrentIndex() triggers do###Changed()
     #Read user input
     rdest,self.rlgval,ruconf,repsg,rfd,rtd = readlist
     
     #--------------------------------------------------------------------
     
     #Destination Menu
     selecteddest = LU.standardiseDriverNames(rdest)
     if selecteddest not in self.destlist:
         self.destlist = self.getConfiguredDestinations()
         self.destcombo.addItem(selecteddest)
     destindex = self.destlist.index(selecteddest) if selecteddest else 0
     
     if self.destcombo.currentIndex() != destindex:
         self.destcombo.setCurrentIndex(destindex)
     
     #InitButton
     self.initbutton.setText('Layer Select')
     
     #Config File
     confindex = 0
     if LU.assessNone(ruconf):
         ruconf = ruconf.split('.')[0]
         if ruconf not in self.cflist:
             self.cflist += [ruconf,]
             self.confcombo.addItem(ruconf)
         confindex = self.cflist.index(ruconf)
         
     if self.confcombo.currentIndex() != confindex:
         self.confcombo.setCurrentIndex(confindex)
     #self.confEdit.setText(ruconf if LU.assessNone(ruconf) else '')
     
     #Layer/Group Selection
     self.updateLGValues(ruconf,self.rlgval,rdest)
     lgindex = None
     if LU.assessNone(self.rlgval):
         #index of list value
         lgindex = self.parent.confconn.getLayerGroupIndex(self.rlgval,col=1)
         
     if LU.assessNone(lgindex):
         #advance by 1 for sep
         lgindex += 1 if lgindex>self.sepindex else 0 
     else:
         #using the separator index sets the combo to blank
         lgindex = self.sepindex
     if self.lgcombo.currentIndex() != lgindex:
         self.lgcombo.setCurrentIndex(lgindex)
     #self.doLGEditUpdate()
     
     #EPSG
     #                                user > layerconf
     #useepsg = LU.precedence(repsg, lce.epsg if lce else None, None)
     epsgindex = [i[0] for i in self.nzlsr+[(None,None)]+self.rowsr].index(repsg)
     if self.epsgcombo.currentIndex() != epsgindex:
         self.epsgcombo.setCurrentIndex(epsgindex)
         
     #epsgedit = self.epsgcombo.lineEdit()
     #epsgedit.setText([e[1] for e in self.nzlsr+self.rowsr if e[0]==repsg][0])
     
     #epsgedit.setText([e for e in self.nzlsr+self.rowsr if re.match('^\s*(\d+).*',e).group(1)==repsg][0])
     
     #To/From Dates
     if LU.assessNone(rfd):
         self.fromdateedit.setDate(QDate(int(rfd[0:4]),int(rfd[5:7]),int(rfd[8:10])))
     else:
         early = DataStore.EARLIEST_INIT_DATE
         self.fromdateedit.setDate(QDate(int(early[0:4]),int(early[5:7]),int(early[8:10])))
         
     if LU.assessNone(rtd):
         self.todateedit.setDate(QDate(int(rtd[0:4]),int(rtd[5:7]),int(rtd[8:10]))) 
     else:
         today = DataStore.getCurrent()
         self.todateedit.setDate(QDate(int(today[0:4]),int(today[5:7]),int(today[8:10])))
开发者ID:josephramsay,项目名称:LDS,代码行数:77,代码来源:LDSGUI.py


注:本文中的lds.LDSUtilities.LDSUtilities.standardiseDriverNames方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。