mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Avoid direct access to platform packages
This commit is contained in:
@ -93,6 +93,10 @@ PLATFORM_PACKAGES = {
|
||||
}
|
||||
|
||||
|
||||
def get_packages():
|
||||
return PLATFORM_PACKAGES
|
||||
|
||||
|
||||
class PlatformFactory(object):
|
||||
|
||||
@staticmethod
|
||||
|
@ -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_}``
|
||||
|
Reference in New Issue
Block a user