Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor issue #77

Merged
merged 2 commits into from
Feb 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rocon_python_utils/src/rocon_python_utils/ros/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
from .resources import find_resource, find_resource_from_string, resource_index_from_package_exports
from .icons import *
from .names import get_ros_friendly_name, check_extension_name
from .paths import get_rocon_home
from .fileio import get_rocon_home, is_validation_file
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,20 @@ def get_rocon_home():
rocon_home = os.path.join(rospkg.get_ros_home(), 'rocon')
if not os.path.isdir(rocon_home):
os.makedirs(rocon_home)
return os.path.join(rospkg.get_ros_home(), 'rocon')
return os.path.join(rospkg.get_ros_home(), 'rocon')

def is_validation_file(file_path):
'''
Investigate whether file is validated or not as checking file existed in path and file size

:param file_path: full file path to check
:type file_path: string

:return: validation of file
:rtype: bool
'''
is_validated = True
if not os.path.isfile(file_path) or os.stat(file_path).st_size <= 0:
is_validated = False

return is_validated