Skip to content

Commit

Permalink
Add system_utils
Browse files Browse the repository at this point in the history
Signed-off-by: Irene Bandera <[email protected]>
  • Loading branch information
irenebm committed Jun 9, 2023
1 parent 79ceb40 commit debffa5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
Empty file.
35 changes: 35 additions & 0 deletions py_utils/py_utils/system/system_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# 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.

"""
This file contains system utils.
"""

import os

def is_linux() -> bool:
"""
@brief Check if the script is running in a Linux environment.
@return: True if the script is running in a Linux environment, False otherwise.
"""
return os.name == 'posix'

def is_windows() -> bool:
"""
@brief Check if the script is running in a Windows environment.
@return: True if the script is running in a Windows environment, False otherwise.
"""
return os.name == 'nt'
1 change: 1 addition & 0 deletions py_utils/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package_name,
package_name + '/debugging',
package_name + '/logging',
package_name + '/system',
package_name + '/time',
package_name + '/wait',
]
Expand Down

0 comments on commit debffa5

Please sign in to comment.