MECO™ API Reference
Public Member Functions | Static Public Attributes | List of all members
mCore.nameSpaceLib.NameSpace Class Reference

[ CLASS ] - Class to operate on namespaces. More...

Inheritance diagram for mCore.nameSpaceLib.NameSpace:
mMayaCore.nameSpaceLib.NameSpace mMayaCore.referenceLib.Reference

Public Member Functions

def __init__ (self, nameSpace=None)
 Constructor. More...
 
def head (self)
 Get name space portion of the name space. More...
 
def tail (self)
 Get the tail portion of the name space. More...
 
def isValid (cls, nameSpace)
 Determine whether given string is a valid name space. More...
 
def removeNameSpace (cls, name)
 Remove name space from the given name. More...
 
def addNameSpace (cls, nameSpace, name, removeExisting=True)
 Add given name space to given name. More...
 
PROPERTIES
def nameSpace (self)
 NameSpace. More...
 
def setNameSpace (self, nameSpace)
 Set name space. More...
 

Static Public Attributes

string NAME_SPACE_DELIMITER = ':'
 [ str ] - Name space delimiter.
 
string FULL_PATH_DELIMITER = '|'
 [ str ] - Full path delimiter.
 

Detailed Description

[ CLASS ] - Class to operate on namespaces.

import sys
_nameSpace = mCore.nameSpaceLib.NameSpace(nameSpace='asset:soldier:armA_01_jnt')
sys.stdout.write(_nameSpace.nameSpace())
# asset:soldier:armA_01_jnt
sys.stdout.write(_nameSpace.head())
# asset:soldier
sys.stdout.write(_nameSpace.tail())
# armA_01_jnt
sys.stdout.write(mCore.nameSpaceLib.NameSpace.isValid('soldier'))
# False

Constructor & Destructor Documentation

◆ __init__()

def mCore.nameSpaceLib.NameSpace.__init__ (   self,
  nameSpace = None 
)

Constructor.

Parameters
nameSpace[ str | None | in ] - NameSpace.
Exceptions
N/A
Returns
None

Reimplemented in mMayaCore.referenceLib.Reference, and mMayaCore.nameSpaceLib.NameSpace.

Member Function Documentation

◆ nameSpace()

def mCore.nameSpaceLib.NameSpace.nameSpace (   self)

NameSpace.

Exceptions
N/A
Returns
str - NameSpace.
None - If name space is not set.

◆ setNameSpace()

def mCore.nameSpaceLib.NameSpace.setNameSpace (   self,
  nameSpace 
)

Set name space.

Parameters
nameSpace[ str | None | in ] - NameSpace.
Returns
bool - Result.

◆ head()

def mCore.nameSpaceLib.NameSpace.head (   self)

Get name space portion of the name space.

Exceptions
N/A
Returns
str - NameSpace portion.

◆ tail()

def mCore.nameSpaceLib.NameSpace.tail (   self)

Get the tail portion of the name space.

Exceptions
N/A
Returns
str - Part portion of the name space.

◆ isValid()

def mCore.nameSpaceLib.NameSpace.isValid (   cls,
  nameSpace 
)

Determine whether given string is a valid name space.

Whether it has NameSpace.NAME_SPACE_DELIMITER in the given string.

Parameters
cls[ object | None | in ] - Class object.
nameSpace[ str | None | in ] - NameSpace.
Exceptions
N/A
Returns
bool - Result.

◆ removeNameSpace()

def mCore.nameSpaceLib.NameSpace.removeNameSpace (   cls,
  name 
)

Remove name space from the given name.

Parameters
cls[ object | None | in ] - Class object.
name[ str | None | in ] - Name.
Exceptions
N/A
Returns
str - Name without name space.

◆ addNameSpace()

def mCore.nameSpaceLib.NameSpace.addNameSpace (   cls,
  nameSpace,
  name,
  removeExisting = True 
)

Add given name space to given name.

Parameters
cls[ object | None | in ] - Class object.
nameSpace[ str | None | in ] - Name space to be added.
name[ str | None | in ] - Name.
removeExisting[ bool | True | in ] - Remove existing name space from the given name before adding the new one.
Exceptions
N/A
Returns
str - Name with name space.

The documentation for this class was generated from the following file:
mCore.nameSpaceLib
[ MODULE ] - Operate on name spaces.
Definition: nameSpaceLib.py:1
mCore.nameSpaceLib.NameSpace
[ CLASS ] - Class to operate on namespaces.
Definition: nameSpaceLib.py:56
mCore.nameSpaceLib.NameSpace.isValid
def isValid(cls, nameSpace)
Determine whether given string is a valid name space.
Definition: nameSpaceLib.py:191