def __init__(self, args, logger=None, mode=None):
self.commandLine = CommandLine(args)
if mode is not None:
self.commandLine.mode = mode
if logger is None:
logging.basicConfig(format="%(asctime)-15s %(levelname)s [%(filename)s:%(lineno)d-%(thread)d] %(message)s")
logger = logging.getLogger()
logger.setLevel(logging.INFO)
self.logger = logger
self.mode = self.__detectMode(self.commandLine.mode)
self.config = self.__loadConfig()
self.inventory = Inventory(logger, self.config)
self.commands = {
'migrate': MigrateCommand(self),
'list-migrations': ListMigrationsCommand(self),
'version': VersionCommand(self),
'help':HelpCommand(self) }
self.defaultCommand = HelpCommand(self)
评论列表
文章目录