Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
Mart Lubbers committed Jun 24, 2014
1 parent b8873ff commit e507077
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 207 deletions.
19 changes: 9 additions & 10 deletions pympi/EafIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

from xml.etree import ElementTree
import sys
import warnings


def parseEaf(filePath, eafObj):
"""
Parse an elan file<br />
<br />
filePath -- Filepath to parse from - for stdin<br />
Parse an elan file
filePath -- Filepath to parse from - for stdin
eafObj -- Object to put the data in"""
if filePath == "-":
filePath = sys.stdin
Expand Down Expand Up @@ -101,8 +100,8 @@ def parseEaf(filePath, eafObj):

def indent(el, level=0):
"""
Pretty prints the xml<br />
<br />
Pretty prints the xml
level -- Level of indenting, only used internally"""
i = '\n' + level*'\t'
if len(el):
Expand All @@ -121,10 +120,10 @@ def indent(el, level=0):

def toEaf(filePath, eafObj, pretty=True):
"""
Write an elan object to a file<br />
<br />
filePath -- Filpath to write to - for stdout<br />
eafObj -- The elan object<br />
Write an elan object to a file
filePath -- Filpath to write to - for stdout
eafObj -- The elan object
pretty -- Use pretty indentation in xml"""
rmNone = lambda x:\
dict((k, unicode(v)) for k, v in x.iteritems() if v is not None)
Expand Down
Loading

0 comments on commit e507077

Please sign in to comment.