Avoid direct access to platform packages

This commit is contained in:
Ivan Kravets
2015-03-14 00:02:09 +02:00
parent bd9ee0c27a
commit c00fecf992
2 changed files with 8 additions and 3 deletions

View File

@ -93,6 +93,10 @@ PLATFORM_PACKAGES = {
}
def get_packages():
return PLATFORM_PACKAGES
class PlatformFactory(object):
@staticmethod

View File

@ -9,7 +9,7 @@ from sys import path
path.append("..")
from platformio import util
from platformio.platforms.base import PLATFORM_PACKAGES, PlatformFactory
from platformio.platforms.base import PlatformFactory, get_packages
def generate_boards(boards):
@ -59,6 +59,7 @@ def generate_boards(boards):
def generate_packages(packages):
allpackages = get_packages()
lines = []
lines.append(""".. list-table::
:header-rows: 1
@ -66,10 +67,10 @@ def generate_packages(packages):
* - Name
- Contents""")
for type_, data in packages.iteritems():
assert type_ in PLATFORM_PACKAGES
assert type_ in allpackages
contitems = [
"`%s <%s>`_" % (name, url)
for name, url in PLATFORM_PACKAGES[type_]
for name, url in allpackages[type_]
]
lines.append("""
* - ``{type_}``