Example #1
0
 def fromStr(self, attrs):
     obj = None
     if AIUtils.isStr(attrs):
         attrs = AIUtils.str2dict(attrs)
         obj = self
         if AIUtils.isDict(attrs):
             for key in attrs:
                 func = getattr(obj, 'set' + AIStrUtils.toUpperF(key))
                 if AIUtils.isFunc(func):
                     apply(func, [attrs[key]])
     else:
         raise Exception('input parameter type not correct!')
     
     return obj
Example #2
0
if __name__ == "__main__":
    qr = ""
    # 获取python服务端根目录
    path = sys.argv[0]
    if os.path.isfile(path):
        path = os.path.dirname(path)
    rootPath = os.path.abspath(os.path.join(path, os.pardir))
    # 读取日志配置
    logging.config.fileConfig(os.path.join(rootPath, "resources", "conf", "logging.conf"))
    logger = logging.getLogger("app.scripts.queryFdsList")
    logger.info("读取Python服务端日志配置成功")
    # 获取参数
    param1 = sys.argv[1]
    param1 = param1.replace("null", "''")
    wksDict = AIUtils.str2dict(param1)
    # 设置工作空间
    wksId = wksDict["id"]
    wksType = wksDict["type"]
    if AIStrUtils.isEqual(wksType, "sde"):
        # 建立相关连接
        cf = ConfigParser.ConfigParser()
        cf.read(os.path.join(rootPath, "resources", "conf", "config.conf"))
        # 获取sde连接文件
        sdeIds = cf.options("sde")
        if wksId in sdeIds:
            sdeInfo = cf.get("sde", wksId)
            sdeInfos = sdeInfo.split("/")
            sdeServer = sdeInfos[0]
            sdeInstance = sdeInfos[1]
            sdeUsername = sdeInfos[2]
Example #3
0
if __name__ == "__main__":
    flag = "false"
    # 获取python服务端根目录
    path = sys.argv[0]
    if os.path.isfile(path):
        path = os.path.dirname(path)
    rootPath = os.path.abspath(os.path.join(path, os.pardir))
    # 读取日志配置
    logging.config.fileConfig(os.path.join(rootPath, "resources", "conf", "logging.conf"))
    logger = logging.getLogger("app.scripts.addFds")
    logger.info("读取Python服务端日志配置成功")
    # 获取参数
    param1 = sys.argv[1]
    param1 = param1.replace("null", "''")
    wksDict = AIUtils.str2dict(param1)
    # 设置工作空间
    wksId = wksDict["id"]
    wksType = wksDict["type"]
    if AIStrUtils.isEqual(wksType, "sde"):
        # 建立相关连接
        cf = ConfigParser.ConfigParser()
        cf.read(os.path.join(rootPath, "resources", "conf", "config.conf"))
        # 获取sde连接文件
        sdeIds = cf.options("sde")
        if wksId in sdeIds:
            sdeInfo = cf.get("sde", wksId)
            sdeInfos = sdeInfo.split("/")
            sdeServer = sdeInfos[0]
            sdeInstance = sdeInfos[1]
            sdeUsername = sdeInfos[2]
Example #4
0
from arccore.store.AIWks import AIWks
if __name__ == '__main__':
    qr = ''
    # 获取python服务端根目录
    path = sys.argv[0]
    if os.path.isfile(path):
        path = os.path.dirname(path)
    rootPath = os.path.abspath(os.path.join(path, os.pardir))
    # 读取日志配置
    logging.config.fileConfig(os.path.join(rootPath, 'resources', 'conf', 'logging.conf'))
    logger = logging.getLogger('app.scripts.queryFds')
    logger.info('读取Python服务端日志配置成功')
    # 获取参数
    param1 = sys.argv[1]
    param1 = param1.replace('null', '\'\'')
    wksDict = AIUtils.str2dict(param1)
    # 设置工作空间
    wksId = wksDict['id']
    wksType = wksDict['type']
    if AIStrUtils.isEqual(wksType, 'sde'):
        # 建立相关连接
        cf = ConfigParser.ConfigParser()
        cf.read(os.path.join(rootPath, 'resources', 'conf', 'config.conf'))     
        # 获取sde连接文件
        sdeIds = cf.options('sde')
        if wksId in sdeIds:
            sdeInfo = cf.get('sde', wksId)
            sdeInfos = sdeInfo.split('/')
            sdeServer = sdeInfos[0]
            sdeInstance = sdeInfos[1]
            sdeUsername = sdeInfos[2]
Example #5
0
from arccore.store.AIWks import AIWks
if __name__ == '__main__':
    qr = ''
    # 获取python服务端根目录
    path = sys.argv[0]
    if os.path.isfile(path):
        path = os.path.dirname(path)
    rootPath = os.path.abspath(os.path.join(path, os.pardir))
    # 读取日志配置
    logging.config.fileConfig(os.path.join(rootPath, 'resources', 'conf', 'logging.conf'))
    logger = logging.getLogger('app.scripts.queryFcList')
    logger.info('读取Python服务端日志配置成功')
    # 获取参数
    param1 = sys.argv[1]
    param1 = param1.replace('null', '\'\'')
    wksDict = AIUtils.str2dict(param1)
    # 设置工作空间
    wksId = wksDict['id']
    wksType = wksDict['type']
    if AIStrUtils.isEqual(wksType, 'sde'):
        # 建立相关连接
        cf = ConfigParser.ConfigParser()
        cf.read(os.path.join(rootPath, 'resources', 'conf', 'config.conf'))     
        # 获取sde连接文件
        sdeIds = cf.options('sde')
        if wksId in sdeIds:
            sdeInfo = cf.get('sde', wksId)
            sdeInfos = sdeInfo.split('/')
            sdeServer = sdeInfos[0]
            sdeInstance = sdeInfos[1]
            sdeUsername = sdeInfos[2]