tests/test_platypus_paragraphs.py
changeset 4315 7c65c6e52b13
parent 4291 1e64956b128b
child 4330 617ffa6bbdc8
equal deleted inserted replaced
4314:27d3ed39ad3e 4315:7c65c6e52b13
   697         a(PageBreak())
   697         a(PageBreak())
   698         a(Paragraph('should be on page template autoFollow 2', normal))
   698         a(Paragraph('should be on page template autoFollow 2', normal))
   699         doc = MyDocTemplate(outputfile('test_platypus_paragraphs_AutoNextPageTemplate.pdf'))
   699         doc = MyDocTemplate(outputfile('test_platypus_paragraphs_AutoNextPageTemplate.pdf'))
   700         doc.build(story)
   700         doc.build(story)
   701 
   701 
       
   702     def testParaBrFlowing(self):
       
   703         from reportlab.platypus import BaseDocTemplate, PageTemplate, Frame, PageBegin
       
   704         from reportlab.lib.units import inch
       
   705         class MyDocTemplate(BaseDocTemplate):
       
   706             _invalidInitArgs = ('pageTemplates',)
       
   707 
       
   708             def __init__(self, filename, **kw):
       
   709                 self.allowSplitting = 0
       
   710                 BaseDocTemplate.__init__(self, filename, **kw)
       
   711                 self.addPageTemplates(
       
   712                         [
       
   713                         PageTemplate('normal',
       
   714                                 [
       
   715                                 Frame(inch, 4.845*inch, 3*inch, 3.645*inch, id='first',topPadding=0,rightPadding=0,leftPadding=0,bottomPadding=0,showBoundary=ShowBoundaryValue(color="red")),
       
   716                                 Frame(4.27*inch, 4.845*inch, 3*inch, 3.645*inch, id='second',topPadding=0,rightPadding=0,leftPadding=0,bottomPadding=0,showBoundary=ShowBoundaryValue(color="red")),
       
   717                                 Frame(inch, inch, 3*inch, 3.645*inch, id='third',topPadding=0,rightPadding=0,leftPadding=0,bottomPadding=0,showBoundary=ShowBoundaryValue(color="red")),
       
   718                                 Frame(4.27*inch, inch, 3*inch, 3.645*inch, id='fourth',topPadding=0,rightPadding=0,leftPadding=0,bottomPadding=0,showBoundary=ShowBoundaryValue(color="red"))
       
   719                                 ],
       
   720                                 ),
       
   721                         ])
       
   722         styleSheet = getSampleStyleSheet()
       
   723         normal = ParagraphStyle(name='normal',fontName='Helvetica',fontSize=10,leading=12,parent=styleSheet['Normal'])
       
   724         bold = ParagraphStyle(name='bold',fontName='Helvetica-Bold',fontSize=12,leading=14.4,parent=normal)
       
   725         brText="""
       
   726 Clearly, the natural general principle that will subsume this case is
       
   727 not subject to a parasitic gap construction.  Presumably, most of the
       
   728 methodological work in modern linguistics can be defined in such a way
       
   729 as to impose the system of base rules exclusive of the lexicon.  In the
       
   730 discussion of resumptive pronouns following (81), the fundamental error
       
   731 of regarding functional notions as categorial is to be regarded as a
       
   732 descriptive <span color="red">fact</span>.<br/>So far, the earlier discussion of deviance is not
       
   733 quite equivalent to a parasitic gap construction.  To characterize a
       
   734 linguistic level L, a case of semigrammaticalness of a different sort
       
   735 may remedy and, at the same time, eliminate irrelevant intervening
       
   736 contexts in selectional <span color="red">rules</span>.<br/>
       
   737 Summarizing, then, we assume that the descriptive power of the base
       
   738 component can be defined in such a way as to impose nondistinctness in
       
   739 the sense of distinctive feature theory.  A lot of sophistication has
       
   740 been developed about the utilization of machines for complex purposes,
       
   741 the notion of level of grammaticalness delimits an abstract underlying
       
   742 <span color="red">order</span>.<br/>To provide a constituent structure for T(Z,K), a subset of
       
   743 English sentences interesting on quite independent grounds appears to
       
   744 correlate rather closely with problems of phonemic and morphological
       
   745 analysis.  For one thing, this analysis of a formative as a pair of sets
       
   746 of features is rather different from a general convention regarding the
       
   747 forms of the grammar.  A lot of sophistication has been developed about
       
   748 the utilization of machines for complex purposes, a case of
       
   749 semigrammaticalness of a different sort is not to be considered in
       
   750 determining an important distinction in language <span color="red">use</span>.<br/>
       
   751 We will bring evidence in favor of the following thesis:  a subset of
       
   752 English sentences interesting on quite independent grounds delimits a
       
   753 descriptive <span color="red">fact</span>.<br/>To characterize a linguistic level L, the notion of
       
   754 level of grammaticalness is not to be considered in determining a
       
   755 parasitic gap construction.  It must be emphasized, once again, that the
       
   756 speaker-hearer's linguistic intuition can be defined in such a way as to
       
   757 impose a stipulation to place the constructions into these various
       
   758 categories.  On our assumptions, the appearance of parasitic gaps in
       
   759 domains relatively inaccessible to ordinary extraction raises serious
       
   760 doubts about problems of phonemic and morphological analysis.  For one
       
   761 thing, the fundamental error of regarding functional notions as
       
   762 categorial is not quite equivalent to a stipulation to place the
       
   763 constructions into these various <span color="red">categories</span>.<br/>
       
   764 Thus the descriptive power of the base component is unspecified with
       
   765 respect to the strong generative capacity of the theory.  Presumably,
       
   766 the theory of syntactic features developed earlier appears to correlate
       
   767 rather closely with a corpus of utterance tokens upon which conformity
       
   768 has been defined by the paired utterance test.  To provide a constituent
       
   769 structure for T(Z,K), a case of semigrammaticalness of a different sort
       
   770 is not to be considered in determining the ultimate standard that
       
   771 determines the accuracy of any proposed grammar.  For any transformation
       
   772 which is sufficiently diversified in application to be of any interest,
       
   773 a subset of English sentences interesting on quite independent grounds
       
   774 raises serious doubts about the requirement that branching is not
       
   775 tolerated within the dominance scope of a complex symbol.  We will bring
       
   776 evidence in favor of the following thesis:  an important property of
       
   777 these three types of EC is not to be considered in determining the
       
   778 system of base rules exclusive of the <span color="red">lexicon</span>.<br/>
       
   779 With this clarification, the descriptive power of the base component is
       
   780 not subject to the requirement that branching is not tolerated within
       
   781 the dominance scope of a complex <span color="red">symbol</span>.<br/>In the discussion of
       
   782 resumptive pronouns following (81), this selectionally introduced
       
   783 contextual feature does not readily tolerate a parasitic gap
       
   784 construction.  Another superficial similarity is the interest in
       
   785 simulation of behavior, a descriptively adequate grammar does not affect
       
   786 the structure of a corpus of utterance tokens upon which conformity has
       
   787 been defined by the paired utterance <span color="red">test</span>.<br/>From C1, it follows that the
       
   788 speaker-hearer's linguistic intuition is not to be considered in
       
   789 determining the traditional practice of grammarians.  Let us continue to
       
   790 suppose that the notion of level of grammaticalness is necessary to
       
   791 impose an interpretation on the system of base rules exclusive of the
       
   792 <span color="red">lexicon</span>.<br/>
       
   793 """
       
   794         story =[]
       
   795         a = story.append
       
   796         a(Paragraph('Paragraph Flowing', bold))
       
   797         a(Paragraph(brText, normal))
       
   798         doc = MyDocTemplate(outputfile('test_platypus_paragraphs_para_br_flowing.pdf'))
       
   799         doc.build(story)
       
   800 
   702 #noruntests
   801 #noruntests
   703 def makeSuite():
   802 def makeSuite():
   704     return makeSuiteForClasses(ParagraphCorners,SplitFrameParagraphTest,FragmentTestCase, ParagraphSplitTestCase, ULTestCase, JustifyTestCase,
   803     return makeSuiteForClasses(ParagraphCorners,SplitFrameParagraphTest,FragmentTestCase, ParagraphSplitTestCase, ULTestCase, JustifyTestCase,
   705             AutoLeadingTestCase)
   804             AutoLeadingTestCase)
   706 
   805