File: helper.py

package info (click to toggle)
python-apptools 4.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,652 kB
  • sloc: python: 16,657; makefile: 77
file content (31 lines) | stat: -rw-r--r-- 1,083 bytes parent folder | download | duplicates (5)
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( '.' )