pyffi :: object_models :: xsd :: FileFormat :: Class FileFormat
[hide private]
[frames] | no frames]

Class FileFormat

source code

object --+    
         |    
FileFormat --+
             |
            FileFormat
Known Subclasses:

This class can be used as a base class for file formats. It implements a number of useful functions such as walking over directory trees and a default attribute naming function.
Nested Classes [hide private]
  __metaclass__
The MetaFileFormat metaclass transforms the XSD description of a xml format into a bunch of classes which can be directly used to manipulate files in this format.
  XsAnyType
Abstract base type for all types.
  XsAnySimpleType
Abstract base type for all simple types.
  XsString
  XsBoolean
  XsDecimal
  XsFloat
  XsDouble
  XsDuration
  XsDateTime
  XsTime
  XsDate
  XsGYearMonth
  XsGYear
  XsGMonthDay
  XsGDay
  XsGMonth
  XsHexBinary
  XsBase64Binary
  XsAnyURI
  XsQName
  XsNotation
  XsNormalizedString
  XsToken
  XsLanguage
  XsNmToken
  XsNmTokens
  XsName
Name represents XML Names.
  XsNCName
NCName represents XML "non-colonized" Names.
  XsId
  XsIdRef
  XsIdRefs
  XsEntity
  XsEntities
  XsInteger
  XsNonPositiveInteger
  XsNegativeInteger
  XsLong
  XsInt
  XsShort
  XsByte
  XsNonNegativeInteger
  XsUnsignedLong
  XsUnsignedInt
  XsUnsignedShort
  XsUnsignedByte
  XsPositiveInteger

Inherited from FileFormat: Data

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
name_parts(cls, name)
Intelligently split a name into parts:
source code

Inherited from FileFormat: name_attribute, name_class, walk, walkData

Static Methods [hide private]

Inherited from FileFormat: version_number

Class Variables [hide private]
  xsdFileName = None
Override.
  xsdFilePath = None
Override.
  logger = logging.getLogger("pyffi.object_models.xsd")

Inherited from FileFormat: ARCHIVE_CLASSES, RE_FILENAME

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

name_parts(cls, name)
Class Method

source code 

Intelligently split a name into parts:

  • first, split at non-alphanumeric characters

  • next, seperate digits from characters

  • finally, if some part has mixed case, it must be camel case so split it further at upper case characters

>>> FileFormat.name_parts("hello_world")
['hello', 'world']
>>> FileFormat.name_parts("HELLO_WORLD")
['HELLO', 'WORLD']
>>> FileFormat.name_parts("HelloWorld")
['Hello', 'World']
>>> FileFormat.name_parts("helloWorld")
['hello', 'World']
>>> FileFormat.name_parts("xs:NMTOKEN")
['xs', 'NMTOKEN']
>>> FileFormat.name_parts("xs:NCName")
['xs', 'N', 'C', 'Name']
>>> FileFormat.name_parts('this IS a sillyNAME')
['this', 'IS', 'a', 'silly', 'N', 'A', 'M', 'E']
>>> FileFormat.name_parts('tHis is A Silly naME')
['t', 'His', 'is', 'A', 'Silly', 'na', 'M', 'E']
Overrides: FileFormat.name_parts
(inherited documentation)