Skip to content

Commit

Permalink
Merge branch 'release/0.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
shidarin committed Apr 9, 2016
2 parents 3dadd04 + 6cd1dad commit 9f9202d
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ the ``-o`` flag.::
Changelog
---------

*New in version 0.9.1:*

- Fixed a bug where ALE's with blank lines would not convert correctly.

*New in version 0.9:*

- Added ability to parse CMX EDLs
Expand Down
2 changes: 1 addition & 1 deletion cdl_convert/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
__copyright__ = "Copyright 2015, Sean Wallitsch"
__credits__ = ["Sean Wallitsch", ]
__license__ = "MIT"
__version__ = "0.9"
__version__ = "0.9.1"
__maintainer__ = "Sean Wallitsch"
__email__ = "shidarin@alphamatte.com"
__status__ = "Development"
Expand Down
5 changes: 4 additions & 1 deletion cdl_convert/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ def parse_ale(input_file): # pylint: disable=R0914
with open(input_file, 'rU') as edl:
lines = edl.readlines()
for line in lines:
if line.startswith('Column'):
if not line.strip():
# Skip entirely blank lines
continue
elif line.startswith('Column'):
section['column'] = True
continue
elif line.startswith('Data'):
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
#########

Version 0.9.1
=============

- Fixed a bug where ALE's with blank lines would not convert correctly.

Version 0.9
===========

Expand Down
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Cinematographers**
Changelog
=========

*New in version 0.9.1:*

- Fixed a bug where ALE's with blank lines would not convert correctly.

*New in version 0.9:*

- Added ability to parse CMX EDLs
Expand Down
48 changes: 48 additions & 0 deletions tests/test_ale.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,54 @@ def setUp(self):
self.cdl2 = self.cdls.color_corrections[1]
self.cdl3 = self.cdls.color_corrections[2]


class TestParseALEShortAndBlankLines(TestParseALEBasic):
"""Tests basic parsing of a shortened ALE with line breaks"""

#==========================================================================
# SETUP & TEARDOWN
#==========================================================================

def setUp(self):
self.slope1 = decimalize(1.329, 0.9833, 1.003)
self.offset1 = decimalize(0.011, 0.013, 0.11)
self.power1 = decimalize(.993, .998, 1.0113)
self.sat1 = Decimal('1.01')

line1 = buildALELine(self.slope1, self.offset1, self.power1, self.sat1,
'bb94_x103_line1', short=True)

# Note that there are limits to the floating point precision here.
# Python will not parse numbers exactly with numbers with more
# significant whole and decimal digits
self.slope2 = decimalize(137829.329, 4327890.9833, 3489031.003)
self.offset2 = decimalize(-3424.011, -342789423.013, -4238923.11)
self.power2 = decimalize(3271893.993, .0000998, 0.0000000000000000113)
self.sat2 = Decimal('1798787.01')

line2 = buildALELine(self.slope2, self.offset2, self.power2, self.sat2,
'bb94_x104_line2', short=True)

self.slope3 = decimalize(1.2, 2.32, 10.82)
self.offset3 = decimalize(-1.3782, 278.32, 0.738378233782)
self.power3 = decimalize(1.329, 0.9833, 1.003)
self.sat3 = Decimal('0.99')

line3 = buildALELine(self.slope3, self.offset3, self.power3, self.sat3,
'bb94_x105_line3', short=True)

self.file = ALE_HEADER_SHORT.replace('Column', 'Column\n\n').replace('Data', 'Data\n\n') + line1 + line2 + line3

# Build our ale
with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
f.write(enc(self.file))
self.filename = f.name

self.cdls = cdl_convert.parse_ale(self.filename)
self.cdl1 = self.cdls.color_corrections[0]
self.cdl2 = self.cdls.color_corrections[1]
self.cdl3 = self.cdls.color_corrections[2]

#==============================================================================
# FUNCTIONS
#==============================================================================
Expand Down

0 comments on commit 9f9202d

Please sign in to comment.