1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#-------------------------------------------------------------------------------
#
# Helper functions/classes useful for implementing various template interfaces.
#
# Written by: David C. Morrill
#
# Date: 07/29/2007
#
# (c) Copyright 2007 by Enthought, Inc.
#
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Returns a properly joined path name:
#-------------------------------------------------------------------------------
def path_for ( *names ):
""" Returns a properly joined path name (i.e. the elements of the name are
separated by '.').
"""
return '.'.join( [ name for name in names if name != '' ] )
#-------------------------------------------------------------------------------
# Parses a possible compound data context name:
#-------------------------------------------------------------------------------
def parse_name ( name ):
""" Parses a possible compound data context name.
"""
return name.split( '.' )
|