def get_stack_version_by_dir(stack_dir):
 manifest_filename = os.path.join(stack_dir, STACK_FILE)
 if os.path.isfile(manifest_filename):
  m = roslib.stack_manifest.parse_file(manifest_filename)
  if m.version:
   return m.version
 cmake_filename = os.path.join(stack_dir, 'CMakeLists.txt')
 if os.path.isfile(cmake_filename):
  with open(cmake_filename) as f:
   return _get_cmake_version(f.read())
 else:
  return None

def get_stack_version_by_dir ( stack_dir ) : manifest_filename = os . path . join ( stack_dir , STACK_FILE ) if os . path . isfile ( manifest_filename ) : m = roslib . stack_manifest . parse_file ( manifest_filename ) if m . version : return m . version cmake_filename = os . path . join ( stack_dir , 'CMakeLists.txt' ) if os . path . isfile ( cmake_filename ) : with open ( cmake_filename ) as f : return _get_cmake_version ( f . read ( ) ) else : return None
get stack version where stack_dir points to root directory of stack .