コード例 #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()
コード例 #3
0
 def __init__(self, *, help):
     """ Initialize the Arg """
     Arg.__init__(self, 'packages', action='store', nargs='+', help=help)
コード例 #4
0
 def getValue(self, args):
     """ Return the value from the args """
     packages = Arg.getValue(self, args)
     return PackageFactory.buildAll(packages)
コード例 #5
0
ファイル: packages_arg.py プロジェクト: cloew/tidypip
 def __init__(self, *, help):
     """ Initialize the Arg """
     Arg.__init__(self, 'packages', action='store', nargs='+', help=help)
コード例 #6
0
ファイル: packages_arg.py プロジェクト: cloew/tidypip
 def getValue(self, args):
     """ Return the value from the args """
     packages = Arg.getValue(self, args)
     return PackageFactory.buildAll(packages)