Support profile oriented style of config.
authorHuang Hao <hao.h.huang@intel.com>
Fri, 7 Sep 2012 07:47:18 +0000 (15:47 +0800)
committerHuang Hao <hao.h.huang@intel.com>
Mon, 10 Sep 2012 03:19:35 +0000 (11:19 +0800)
commitfa8b8a97e670c738cad3de9b6efda0c1c3bc97b0
tree4c3e5bbe334e9e0b9b661da46b7494b0fce98039
parentfac40c04cebf673fd1bee0901e92eb7a52b5cd3a
Support profile oriented style of config.

- support profile oriented style. It is compatible with subcommand
    oriented style.
- add a class Profile to store url/user/password of repos and api.
- add a class BizConfigManager extending from ConfigMgr. It
    handles profile info and does not care about multi-levels and
    passwdx issues. It returns current profile instance even
    config file has subcommand oriented style.
- make two functions decode_passwdx, encode_passwd to convert
    between passwd and passwdx.
- move get_repos_conf() from cmd_build.py to conf.py and split it
    into two parts
    _parse_build_repos() and _build_profile_by_subcommand()
- add test cases in test_profile.py

Change-Id: I81b2906456766f1061ccef9e7d51fea794c59409
12 files changed:
gitbuildsys/cmd_build.py
gitbuildsys/cmd_remotebuild.py
gitbuildsys/conf.py
gitbuildsys/safe_url.py
gitbuildsys/utils.py
tests/test_profile.py [new file with mode: 0644]
tests/test_safe_url.py
tests/testdata/ini/local_repo.ini [new file with mode: 0644]
tests/testdata/ini/no_such_profile_section_name.ini [new file with mode: 0644]
tests/testdata/ini/profile.ini [new file with mode: 0644]
tests/testdata/ini/profile_only_has_api.ini [new file with mode: 0644]
tests/testdata/ini/subcommand.ini [new file with mode: 0644]