本文整理汇总了Python中lds.LDSUtilities.LDSUtilities.standardiseUserConfigName方法的典型用法代码示例。如果您正苦于以下问题:Python LDSUtilities.standardiseUserConfigName方法的具体用法?Python LDSUtilities.standardiseUserConfigName怎么用?Python LDSUtilities.standardiseUserConfigName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lds.LDSUtilities.LDSUtilities
的用法示例。
在下文中一共展示了LDSUtilities.standardiseUserConfigName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseUserConfigName [as 别名]
def __init__(self,cfpath=None,use_defaults=True):
'''
Constructor
'''
from lds.DataStore import DataStore
self.driverconfig = {i:() for i in DataStore.DRIVER_NAMES}
self.use_defaults = use_defaults
#if we dont give the constructor a file path is uses the template file which will fill in any default values missed in the user conf
#but if cpath is requested and doesn't exist we initialise it, otherwise you end up trying to overwrite the template
if cfpath is None:
self.filename = LU.standardiseUserConfigName(self.DEFAULT_MF)
else:
#Standardise since there is no guarantee cfpath is going to be in the reqd format to start with (since its a user entry)
self.filename = LU.standardiseUserConfigName(cfpath)
self.cp = None
self.initMainFile()
self.fn = re.search('(.+)\.conf',os.path.basename(self.filename)).group(1)
示例2: runReplicationScript
# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseUserConfigName [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()
示例3: launchUCEditor
# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseUserConfigName [as 别名]
def launchUCEditor(self, checked=None):
'''User Config Editor launch'''
fn = LU.standardiseUserConfigName(str(self.controls.cflist[self.controls.confcombo.currentIndex()]))
prefs = LDSPrefsEditor(fn,self)
prefs.setWindowTitle('LDS Preferences Editor (User Config)')
prefs.show()
示例4: setupMainAndUserConfig
# 需要导入模块: from lds.LDSUtilities import LDSUtilities [as 别名]
# 或者: from lds.LDSUtilities.LDSUtilities import standardiseUserConfigName [as 别名]
def setupMainAndUserConfig(self,inituserconfig):
'''Sets up a reader to the main configuration file or alternatively, a user specified config file.
Userconfig is not mean't to replace mainconfig, just overwrite the parts the user has decided to customise'''
#self.userconfig = None
self.userconfig = MainFileReader(LDSUtilities.standardiseUserConfigName(inituserconfig),False) if inituserconfig else None
self.mainconfig = MainFileReader()