コード例 #1
0
class ImportAmbiguityCmd:
    """ Command to import an Ambiguity Group file and create the proper Ambiguity Groups """
    description = "Import a file to seed the Ambiguity Groups"
    args = [Arg('filename', action='store', help="The file to load")]

    def run(self, *, filename):
        """ Create the new log entry """
        groups = LoadAmbiguityGroups(filename)
        loader = AmbiguityLoader(groups)

        loader.load()
コード例 #2
0
ファイル: import_cmd.py プロジェクト: cloew/VocabTester
class ImportCmd:
    """ Command to import a file and create the necessary Words/Symbols """
    description = "Import a file to seed the database"
    args = [Arg('filename', action='store', help="The file to load"),
            FlagArg('-l', '--listname',  action='store', help="Name of the Concept List to create from the given elements")]
    
    def run(self, *, filename, listname):
        """ Create the new log entry """
        eggs = LoadEggs(filename)
        loader = EggsLoader(eggs)
        loader.load()
        
        if listname is not None:
            ConceptListLoader(listname, eggs, loader.concepts).load()