Files

72 lines
2.1 KiB
Python
Raw Permalink Normal View History

2019-10-17 00:17:16 +03:00
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from platformio import util
from platformio.exception import PlatformioException, UserSideException
2019-10-17 00:17:16 +03:00
class PackageException(PlatformioException):
pass
class ManifestException(PackageException):
2019-10-17 00:17:16 +03:00
pass
2020-01-03 15:52:54 +02:00
class UnknownManifestError(ManifestException):
pass
2019-10-17 00:17:16 +03:00
class ManifestParserError(ManifestException):
pass
class ManifestValidationError(ManifestException):
def __init__(self, messages, data, valid_data):
2019-10-17 00:17:16 +03:00
super(ManifestValidationError, self).__init__()
self.messages = messages
2019-10-17 00:17:16 +03:00
self.data = data
self.valid_data = valid_data
2019-10-17 00:17:16 +03:00
def __str__(self):
return (
"Invalid manifest fields: %s. \nPlease check specification -> "
"https://docs.platformio.org/page/librarymanager/config.html"
% self.messages
2019-10-17 00:17:16 +03:00
)
class MissingPackageManifestError(ManifestException):
MESSAGE = "Could not find one of '{0}' manifest files in the package"
class UnknownPackageError(UserSideException):
MESSAGE = (
2020-09-02 18:49:00 +03:00
"Could not find the package with '{0}' requirements for your system '%s'"
% util.get_systype()
)
2020-08-22 17:48:49 +03:00
class NotGlobalLibDir(UserSideException):
MESSAGE = (
"The `{0}` is not a PlatformIO project.\n\n"
"To manage libraries in global storage `{1}`,\n"
"please use `platformio lib --global {2}` or specify custom storage "
"`platformio lib --storage-dir /path/to/storage/ {2}`.\n"
"Check `platformio lib --help` for details."
)