diff options
author | Rickard Bolin <rickard.bolin@arm.com> | 2022-05-24 07:43:03 +0000 |
---|---|---|
committer | Rickard Bolin <rickard.bolin@arm.com> | 2022-05-24 10:17:02 +0000 |
commit | 9b8b4489558e41b4e5862bf3793cd089e3ad28f8 (patch) | |
tree | f9ae90421460329dd96e8cb3c8b258aa8d9cc34c /ethosu/vela/vela.py | |
parent | c3597d1176e0366c52e5b22c8325a724afab29e5 (diff) | |
download | ethos-u-vela-9b8b4489558e41b4e5862bf3793cd089e3ad28f8.tar.gz |
MLBEDSW-6593: Issue with finding some config files
The argument to the lstrip function is a list of all characters that
should be stripped from the beginning of the string, in any order. To
remove the actual prefix, check if the string starts with the string
instead and then remove that amount of characters. The function
"removeprefix" was added in python3.9 which does exactly this, but
that is not yet available to vela since it supports python 3.7.
Signed-off-by: Rickard Bolin <rickard.bolin@arm.com>
Change-Id: Ibc5a173c6d422cb5f55feb80caef6c5c30cf7d39
Diffstat (limited to 'ethosu/vela/vela.py')
-rw-r--r-- | ethosu/vela/vela.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ethosu/vela/vela.py b/ethosu/vela/vela.py index 62078007..ee4de5dc 100644 --- a/ethosu/vela/vela.py +++ b/ethosu/vela/vela.py @@ -287,9 +287,10 @@ def generate_supported_ops(): def list_config_files(): - print("\nAvailable config files:\n") + print("Available config files:") + path_length = len(CONFIG_FILES_PATH + os.path.sep) for config in glob.glob(os.path.join(CONFIG_FILES_PATH, "*", "*.ini")): - print(config.lstrip(CONFIG_FILES_PATH + os.path.sep)) + print(config[path_length:]) def main(args=None): @@ -470,11 +471,11 @@ def main(args=None): config_path = os.path.join(CONFIG_FILES_PATH, config) else: print( - f"Warning: Configuration file `{config}` not located in a folder directly under the " - "`config_files` directory. Note that the file depth from the `config_files` directory must be " - "exactly 2 to be discovered via the --list-config-files mechanism " - "(e.g. `config_files/directory_name/my_config_file.ini`). This config file will still be " - "parsed however, and treated as an absolute path config instead." + f"Warning: Configuration file `{config}` is either not located in a folder directly under the " + "`config_files` directory or has not been provided correctly. Note that the file depth from the " + "`config_files` directory must be exactly 2 to be discovered via the --list-config-files " + "mechanism (e.g. `directory_name/my_config_file.ini` located in the config_files directory). " + "This config file will still be parsed however, and treated as an absolute path config instead." ) config_path = config |