|
and so on. Every package has a category, and the file is neatly ordered. That is important: The input data needs to be sorted for what we are going to do now – what I want is to construct a dictionary from this file that looks like:- {
- "app-editors": [
- "app-editors/vim"
- ],
- "dev-lang": [
- "dev-lang/python",
- "dev-lang/ruby"
- ],
- "dev-python": [
- "dev-python/cython",
- "dev-python/pyatspi",
- "dev-python/pygments",
- "dev-python/setuptools",
- "dev-python/virtualenv"
- ],
- "dev-util": [
- "dev-util/ccache",
- "dev-util/cunit",
- "dev-util/meld",
- "dev-util/perf"
- ],
- "dev-vcs": [
- "dev-vcs/bzr",
- "dev-vcs/tig",
- "dev-vcs/git"
- ],
- # ... snip ...
- }
复制代码 |
|