mbed SDK
Copyright (c) 2011-2013 ARM Limited
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.
Function Documentation
def tools::utils::argparse_deprecate
(
replacement_message )
fail if argument is provided with deprecation warning
An argument parser that verifies that a string passed in is either
absolute path or a file name (expanded to
mbed-os/tools/profiles/<fname>.json) of a existing file
Abort with an error that was generated by the arguments to a CLI program
Positional arguments:
parser - the ArgumentParser object that parsed the command line
message - what went wrong
Function checks for Python modules which should be "importable"
before test suite can be used.
@return returns True if all modules are installed already
render a list of strings as a in a bunch of columns
Positional arguments:
strings - the strings to columnate
Keyword arguments;
separator - the separation between the columns
chars - the maximum with of a row
Implement the behaviour of "shutil.copy(src, dst)" without copying the
permissions (this was causing errors with directories mounted with samba)
Positional arguments:
src - the source of the copy operation
dst - the destination of the copy operation
Utility function: traverse a dictionary and change all the strings in
the dictionary to ASCII from Unicode. Useful when reading ASCII JSON data,
because the JSON decoder always returns Unicode string. Based on
http://stackoverflow.com/a/13105359
Positional arguments:
dictionary - The dict that contains some Unicode that should be ASCII
Returns the absolute path to a command.
None is returned if no absolute path was found.
Positional arguhments:
command - the command to find the path of
When called inside a function, it returns the name
of the caller of that function.
Keyword arguments:
steps - the number of steps up the stack the calling function is
Given a path, return the number of directory levels present.
This roughly translates to the number of path separators (os.sep) + 1.
Ex. Given "path/to/dir", this would return 3
Special cases: "." and "/" return 0
Positional arguments:
path - the path to calculate the depth of
Read a JSON file and return its Python representation, transforming all
the strings from Unicode to ASCII. The order of keys in the JSON file is
preserved.
Positional arguments:
fname - the name of the file to parse
Breaks a string up into smaller pieces before print them
This is a limitation within Windows, as detailed here:
https://bugs.python.org/issue11395
Positional arguments:
large_string - the large string to print
Relative path calculation that optionaly always starts with a dot
Positional arguments:
path - the path to make relative
base - what to make the path relative to
Keyword arguments:
dot - if True, the path will always start with a './'
Run a command in the forground
Positional arguments:
command - the command to run
Keyword arguments:
work_dir - the working directory to run the command in
chroot - the chroot to run the command in
redirect - redirect the stderr to a pipe to be used later
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.