msl.package_manager.utils module
Functions for the API.
- msl.package_manager.utils.get_email()[source]
Try to determine the user’s email address.
If git is installed then it returns the
user.email
parameter from the user’s git account to use as the user’s email address. If git is not installed then returnsNone
.
- msl.package_manager.utils.get_username()[source]
Determine the name of the user.
If git is installed then it returns the
user.name
parameter from the user’s git account. If git is not installed or if theuser.name
parameter does not exist thengetpass.getuser()
is used to determine the username.- Returns:
str
– The user’s name.
- msl.package_manager.utils.github(update_cache=False)[source]
Get the information about the MSL repositories that are available on GitHub.
- Parameters:
update_cache (
bool
, optional) – The information about the repositories that are available on GitHub are cached to use for subsequent calls to this function. After 24 hours the cache is automatically updated. Set update_cache to beTrue
to force the cache to be updated when you call this function.- Returns:
dict
– The information about the MSL repositories that are available on GitHub.
- msl.package_manager.utils.info(from_github=False, from_pypi=False, update_cache=False, as_json=False)[source]
Show information about MSL packages.
The information about the packages can be either those that are installed or those that are available as repositories on GitHub or as packages on PyPI.
The default action is to show the information about the MSL packages that are installed.
- Parameters:
from_github (
bool
, optional) – Whether to show the information about the MSL repositories that are available on GitHub.from_pypi (
bool
, optional) – Whether to show the information about the MSL packages that are available on PyPI.update_cache (
bool
, optional) – The information about the MSL packages that are available on PyPI and about the repositories that are available on GitHub are cached to use for subsequent calls to this function. After 24 hours the cache is automatically updated. Set update_cache to beTrue
to force the cache to be updated when you call this function. If from_github isTrue
then the cache for the repositories is updated. If from_pypi isTrue
then the cache for the packages is updated.as_json (
bool
, optional) – Whether to show the information in JSON format. If enabled then the information about the MSL repositories includes additional information about the branches and tags.
- msl.package_manager.utils.installed()[source]
Get the information about the MSL packages that are installed.
- Returns:
dict
– The information about the MSL packages that are installed.
- msl.package_manager.utils.outdated_pypi_packages(msl_installed=None)[source]
Check PyPI for all non-MSL packages that are outdated.
New in version 2.5.0.
- Parameters:
msl_installed (
dict
, optional) – The MSL packages that are installed. If not specified then callsinstalled()
to determine the installed packages.- Returns:
dict
– The information about the PyPI packages that are outdated.
- msl.package_manager.utils.pypi(update_cache=False)[source]
Get the information about the MSL packages that are available on PyPI.
- Parameters:
update_cache (
bool
, optional) – The information about the MSL packages that are available on PyPI are cached to use for subsequent calls to this function. After 24 hours the cache is automatically updated. Set update_cache to beTrue
to force the cache to be updated when you call this function.- Returns:
dict
– The information about the MSL packages that are available on PyPI.
- msl.package_manager.utils.set_log_level(level)[source]
Set the logging level.
- Parameters:
level (
int
) – A value from one of the Logging Levels.