aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Vilcans <martin@librador.com>2011-11-28 01:51:28 +0100
committerMartin Vilcans <martin@librador.com>2011-11-28 01:52:32 +0100
commit98d3e6a81a4fa49a57a448b06bf6a75d676a547d (patch)
tree87dcb590cfae969188529a6e11a38b63a2004a51
parentf6e03e424ad21f86368606cca65448f75d1e1ecf (diff)
downloadscreenplain-98d3e6a81a4fa49a57a448b06bf6a75d676a547d.tar.gz
Removed unused non-working old plain text formatting
-rw-r--r--screenplain/types.py60
1 files changed, 0 insertions, 60 deletions
diff --git a/screenplain/types.py b/screenplain/types.py
index 985d7cc..d8e310d 100644
--- a/screenplain/types.py
+++ b/screenplain/types.py
@@ -18,16 +18,6 @@ class Slug(object):
class Dialog(object):
- indent_character = ' ' * 22
- indent_dialog = ' ' * 10
- indent_parenthetical_first = ' ' * 16
- indent_parenthetical_subsequent = ' ' * 17
-
- fill_parenthetical = 45
- fill_dialog = 45
-
- top_margin = 1
-
def __init__(self, character, lines):
self.character = character
self.blocks = [] # list of tuples of (is_parenthetical, text)
@@ -42,73 +32,23 @@ class Dialog(object):
if line.endswith(')'):
inside_parenthesis = False
- def format(self):
- yield self.indent_character + self.character
-
- for parenthetical, text in self.blocks:
- if parenthetical:
- lines = textwrap.wrap(
- text,
- width=self.fill_parenthetical,
- initial_indent=self.indent_parenthetical_first,
- subsequent_indent=self.indent_parenthetical_subsequent
- )
- else:
- lines = textwrap.wrap(
- text,
- width=self.fill_dialog,
- initial_indent=self.indent_dialog,
- subsequent_indent=self.indent_dialog
- )
- for line in lines:
- yield line
-
class DualDialog(object):
- top_margin = 1
-
def __init__(self, character1, lines1, character2, lines2):
self.left = Dialog(character1, lines1)
self.right = Dialog(character2, lines2)
- def format(self):
- # FIXME: I haven't checked yet how dual dialog is supposed to look.
- llines = list(self.left.format())
- rlines = list(self.right.format())
- llines += [''] * (len(rlines) - len(llines))
- rlines += [''] * (len(llines) - len(rlines))
- for left, right in zip(llines, rlines):
- yield '%-34s%s' % (left, right)
-
class Action(object):
- indent = ''
- fill = 68
- top_margin = 1
-
def __init__(self, lines, centered=False):
self.lines = lines
self.centered = centered
- def format(self):
- for logical_line in self.lines:
- for line in textwrap.wrap(logical_line, width=self.fill):
- yield self.indent + line
-
class Transition(object):
- indent = ''
- fill = 68
- top_margin = 1
-
def __init__(self, line):
self.line = line
@property
def lines(self):
return [self.line]
-
- def format(self):
- for logical_line in self.lines:
- for line in textwrap.wrap(logical_line, width=self.fill):
- yield self.indent + line