Beispiel #1
0
def LoadDictionaries(path):
	dictionaries = {}
	dicts = listFiles(path, '*.xml', recurse=0)
	for dict in dicts:
		(name,choices) = LoadDictionary(dict)
		dictionaries[name] = choices
	return dictionaries
Beispiel #2
0
def LoadTransactions(path, fielddef, config):
    transDescs = []
    cases = listFiles(path, '*.xml', recurse=0)
    for case in cases:
        transDesc = CreateTransDescObject(fielddef, case, config)
        transDescs.append(transDesc)
    return transDescs
Beispiel #3
0
def LoadPackageHeader(path, fielddef, config):
    transDescs = []
    headers = listFiles(path, 'PackageHeader.xml', recurse=0)

    if len(headers) == 1:
        package = CreateTransDescObject(fielddef, headers[0], config)
    else:
        package = Package(fielddef, config)
    return package
Beispiel #4
0
def openProject(path):
    from ListFile import listFiles

    projects = listFiles(path, '*.prj', recurse=0)
    projects.sort()
    dlg = OpenProjectDialog(None, "Open Project", projects)
    dlg.CenterOnScreen()
    val = dlg.ShowModal()
    if (val == wx.ID_OK):
        pass
    dlg.Destroy()
    return dlg.theProject
Beispiel #5
0
def LoadCommandFuncsSuffix(suffix):
    func_hash = {}
    commands = listFiles('commands', 'command??'+suffix, recurse=0)
    for command in commands:
#        command = re.sub(r"commands\\", "", command)
        command = re.sub(r"commands\/", "", command)
        command = re.sub(suffix, "", command)
        module = __import__(command)
        for funcname in module.__dict__.keys():
            m = re.match('^command_(..)$', funcname)
            if (m != None):
                if func_hash.has_key(m.group(1)):
                    raise ValueError('command[' + m.group(1) + '] duplicated')
                func_hash[m.group(1)] = module.__dict__[funcname]

    return func_hash