コード例 #1
0
ファイル: config.py プロジェクト: ardikabs/dnsmanager-suites
 def config_path(self):
     import os
     cls = self.__class__
     configfile_names = list(
         generate_configfile_names(cls.config_files, cls.config_searchpath))
     config_param = Param(type=click.File("r"))
     config_file = config_param.parse(configfile_names[0])
     return os.path.realpath(config_file.name)
コード例 #2
0
    def config_path(self):
        import os
        cls = self.__class__
        config_param = Param(type=click.File('r'))
        configfile_names = list(
            generate_configfile_names(cls.config_files, cls.config_searchpath))

        if configfile_names:
            for name in configfile_names:
                config_file = config_param.parse(name)
                path = os.path.realpath(config_file.name)
        else:
            path = os.getcwd()
        return path