<reponame>jiangfengbing/pic2alioss<filename>src/saveconfig.py<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import json

__author__ = "<NAME>"
__copyright__ = "Copyright 2020 <NAME>. All rights reserved."


def main():
    try:
        lines = sys.stdin.readlines()
        data = []
        for line in lines:
            line = line.rstrip()
            data.append(line)

        config = {
            'bucket': data[0],
            'endpoint': data[1],
            'accessKeyId': data[2],
            'accessKeySecret': data[3],
            'urlPrefix': data[4]
        }
        open('config.json', 'w').write(json.dumps(config))
        print('配置成功!')
        return
    except:
        pass
    print('配置失败!')


if __name__ == '__main__':
    main()

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import json

__author__ = "<NAME>"
__copyright__ = "Copyright 2020 <NAME>. All rights reserved."


def main():
    try:
        lines = sys.stdin.readlines()
        data = []
        for line in lines:
            line = line.rstrip()
            data.append(line)

        config = {
            'bucket': data[0],
            'endpoint': data[1],
            'accessKeyId': data[2],
            'accessKeySecret': data[3],
            'urlPrefix': data[4]
        }
        open('config.json', 'w').write(json.dumps(config))
        print('配置成功!')
        return
    except:
        pass
    print('配置失败!')


if __name__ == '__main__':
    main()
#!/usr/bin/env python # -*- coding: utf-8 -*-