moved sources into subdirectory for easier setup

This commit is contained in:
Stefan Klug 2015-10-27 22:36:51 +01:00
parent 4f91a30fec
commit d93f8ce937
190 changed files with 4 additions and 4 deletions

16
appy/pod/test/Readme.txt Normal file
View file

@ -0,0 +1,16 @@
Here you will find some ODT documents that are POD templates.
A POD template is a standard ODT file, where:
- notes are used to insert Python-based code for telling POD to render
a portion of the document zero, one or more times ("if" and "for" statements);
- text insertions in "track changes" mode are interpreted as Python expressions.
When you run the Tester.py program with one of those ODT files as unique parameter
(ie "python Tester.py ForCellOnlyOne.odt"), you get a result.odt file which is the
result of executing the template with a bunch of Python objects. The "tests" dictionary
defined in Tester.py contains the objects that are given to each POD ODT template
contained in this folder.
Opening the templates with OpenOffice (2.0 or higher), running Tester.py on it and
checking the result in result.odt is probably the quickest way to have a good idea
of what appy.pod can make for you !

234
appy/pod/test/Tester.py Normal file
View file

@ -0,0 +1,234 @@
# ------------------------------------------------------------------------------
# Appy is a framework for building applications in the Python language.
# Copyright (C) 2007 Gaetan Delannay
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA.
# ------------------------------------------------------------------------------
import os, os.path, sys, zipfile, re, shutil
import appy.shared.test
from appy.shared.test import TesterError
from appy.shared.utils import FolderDeleter
from appy.shared.xml_parser import escapeXml
from appy.pod.odf_parser import OdfEnvironment, OdfParser
from appy.pod.renderer import Renderer
# TesterError-related constants ------------------------------------------------
TEMPLATE_NOT_FOUND = 'Template file "%s" was not found.'
CONTEXT_NOT_FOUND = 'Context file "%s" was not found.'
EXPECTED_RESULT_NOT_FOUND = 'Expected result "%s" was not found.'
# ------------------------------------------------------------------------------
class AnnotationsRemover(OdfParser):
'''This parser is used to remove from content.xml and styles.xml the
Python tracebacks that may be dumped into OpenDocument annotations by
pod when generating errors. Indeed, those tracebacks contain lot of
machine-specific info, like absolute paths to the python files, etc.'''
def __init__(self, env, caller):
OdfParser.__init__(self, env, caller)
self.res = ''
self.inAnnotation = False # Are we parsing an annotation ?
self.textEncountered = False # Within an annotation, have we already
# met a text ?
self.ignore = False # Must we avoid dumping the current tag/content
# into the result ?
def startElement(self, elem, attrs):
e = OdfParser.startElement(self, elem, attrs)
# Do we enter into an annotation ?
if elem == '%s:annotation' % e.ns(e.NS_OFFICE):
self.inAnnotation = True
self.textEncountered = False
elif elem == '%s:p' % e.ns(e.NS_TEXT):
if self.inAnnotation:
if not self.textEncountered:
self.textEncountered = True
else:
self.ignore = True
if not self.ignore:
self.res += '<%s' % elem
for attrName, attrValue in list(attrs.items()):
self.res += ' %s="%s"' % (attrName, attrValue)
self.res += '>'
def endElement(self, elem):
e = OdfParser.endElement(self, elem)
if elem == '%s:annotation' % e.ns(e.NS_OFFICE):
self.inAnnotation = False
self.ignore = False
if not self.ignore:
self.res += '</%s>' % elem
def characters(self, content):
e = OdfParser.characters(self, content)
if not self.ignore: self.res += escapeXml(content)
def getResult(self):
return self.res
# ------------------------------------------------------------------------------
class Test(appy.shared.test.Test):
'''Abstract test class.'''
interestingOdtContent = ('content.xml', 'styles.xml')
def __init__(self, testData, testDescription, testFolder, config, flavour):
appy.shared.test.Test.__init__(self, testData, testDescription,
testFolder, config, flavour)
self.templatesFolder = os.path.join(self.testFolder, 'templates')
self.contextsFolder = os.path.join(self.testFolder, 'contexts')
self.resultsFolder = os.path.join(self.testFolder, 'results')
self.result = None
def getContext(self, contextName):
'''Gets the objects that are in the context.'''
contextPy = os.path.join(self.contextsFolder, contextName + '.py')
if not os.path.exists(contextPy):
raise TesterError(CONTEXT_NOT_FOUND % contextPy)
contextPkg = 'appy.pod.test.contexts.%s' % contextName
exec('import %s' % contextPkg)
exec('context = dir(%s)' % contextPkg)
res = {}
for elem in context:
if not elem.startswith('__'):
exec('res[elem] = %s.%s' % (contextPkg, elem))
return res
def do(self):
self.result = os.path.join(
self.tempFolder, '%s.%s' % (
self.data['Name'], self.data['Result']))
# Get the path to the template to use for this test
if self.data['Template'].endswith('.ods'):
suffix = ''
else:
# For ODT, which is the most frequent case, no need to specify the
# file extension.
suffix = '.odt'
template = os.path.join(self.templatesFolder,
self.data['Template'] + suffix)
if not os.path.exists(template):
raise TesterError(TEMPLATE_NOT_FOUND % template)
# Get the context
context = self.getContext(self.data['Context'])
# Get the OpenOffice port
ooPort = self.data['OpenOfficePort']
pythonWithUno = self.config['pythonWithUnoPath']
# Get the styles mapping
stylesMapping = eval('{' + self.data['StylesMapping'] + '}')
# Mmh, dicts are not yet managed by RtfTablesParser
# Call the renderer.
Renderer(template, context, self.result, ooPort=ooPort,
pythonWithUnoPath=pythonWithUno,
stylesMapping=stylesMapping).run()
# Store all result files
# I should allow to do this from an option given to Tester.py: this code
# keeps in a separate folder the odt results of all ran tests.
#tempFolder2 = '%s/sevResults' % self.testFolder
#if not os.path.exists(tempFolder2):
# os.mkdir(tempFolder2)
#print('Result is %s, temp folder 2 is %s.' % (self.result,tempFolder2))
#shutil.copy(self.result, tempFolder2)
def getOdtContent(self, odtFile):
'''Creates in the temp folder content.xml and styles.xml extracted
from p_odtFile.'''
contentXml = None
stylesXml = None
if odtFile == self.result:
filePrefix = 'actual'
else:
filePrefix = 'expected'
zipFile = zipfile.ZipFile(odtFile)
for zippedFile in zipFile.namelist():
if zippedFile in self.interestingOdtContent:
f = file(os.path.join(self.tempFolder,
'%s.%s' % (filePrefix, zippedFile)), 'wb')
fileContent = zipFile.read(zippedFile)
if zippedFile == 'content.xml':
# Sometimes, in annotations, there are Python tracebacks.
# Those tracebacks include the full path to the Python
# files, which of course may be different from one machine
# to the other. So we remove those paths.
annotationsRemover = AnnotationsRemover(
OdfEnvironment(), self)
annotationsRemover.parse(fileContent)
fileContent = annotationsRemover.getResult()
try:
f.write(fileContent.encode('utf-8'))
except UnicodeDecodeError:
f.write(fileContent)
f.close()
zipFile.close()
def checkResult(self):
'''r_ is False if the test succeeded.'''
# Get styles.xml and content.xml from the actual result
res = False
self.getOdtContent(self.result)
# Get styles.xml and content.xml from the expected result
expectedResult = os.path.join(self.resultsFolder,
self.data['Name'] + '.' + self.data['Result'])
if not os.path.exists(expectedResult):
raise TesterError(EXPECTED_RESULT_NOT_FOUND % expectedResult)
self.getOdtContent(expectedResult)
for fileName in self.interestingOdtContent:
diffOccurred = self.compareFiles(
os.path.join(self.tempFolder, 'actual.%s' % fileName),
os.path.join(self.tempFolder, 'expected.%s' % fileName),
areXml=True, xmlTagsToIgnore=(
(OdfEnvironment.NS_DC, 'date'),
(OdfEnvironment.NS_STYLE, 'style')),
xmlAttrsToIgnore=('draw:name','text:name','text:bullet-char',
'table:name', 'table:style-name'),
encoding='utf-8')
if diffOccurred:
res = True
break
return res
# Concrete test classes --------------------------------------------------------
class NominalTest(Test):
'''Tests an application model.'''
def __init__(self, testData, testDescription, testFolder, config, flavour):
Test.__init__(self, testData, testDescription, testFolder, config,
flavour)
class ErrorTest(Test):
'''Tests an application model.'''
def __init__(self, testData, testDescription, testFolder, config, flavour):
Test.__init__(self, testData, testDescription, testFolder, config,
flavour)
def onError(self):
'''Compares the error that occurred with the expected error.'''
Test.onError(self)
return not self.isExpectedError(self.data['Message'])
# ------------------------------------------------------------------------------
class PodTestFactory(appy.shared.test.TestFactory):
def createTest(testData, testDescription, testFolder, config, flavour):
if testData.table.instanceOf('ErrorTest'):
test = ErrorTest(testData, testDescription, testFolder, config,
flavour)
else:
test = NominalTest(testData, testDescription, testFolder, config,
flavour)
return test
createTest = staticmethod(createTest)
# ------------------------------------------------------------------------------
class PodTester(appy.shared.test.Tester):
def __init__(self, testPlan):
appy.shared.test.Tester.__init__(self, testPlan, [], PodTestFactory)
# ------------------------------------------------------------------------------
if __name__ == '__main__':
PodTester('Tests.rtf').run()
# ------------------------------------------------------------------------------

1895
appy/pod/test/Tests.rtf Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,5 @@
johnScore = 25
markScore = 53
wilsonScore = 12
meghuScore = 59

View file

@ -0,0 +1,137 @@
# -*- coding: utf-8 -*-
xhtmlInput='''
<table cellspacing="0" cellpadding="0" id="configabsences_cal" class="list timeline">
<colgroup>
<col width="100px"/>
<col style=""/><col style=""/><col style=""/><col style=""/><col style="background-color: #dedede"/><col style="background-color: #c0c0c0"/><col style="background-color: #c0c0c0"/><col style=""/><col style=""/><col style=""/><col style=""/><col style="background-color: #dedede"/><col style="background-color: #c0c0c0"/><col style="background-color: #c0c0c0"/><col style=""/><col style=""/><col style=""/><col style=""/><col style="background-color: #dedede"/><col style="background-color: #c0c0c0"/><col style="background-color: #c0c0c0"/><col style=""/><col style=""/><col style=""/><col style=""/><col style="background-color: #dedede"/><col style="background-color: #c0c0c0"/><col style="background-color: #c0c0c0"/><col style=""/><col style=""/><col style=""/><col style=""/><col style="background-color: #dedede"/><col style="background-color: #c0c0c0"/><col style="background-color: #c0c0c0"/><col style=""/><col style=""/><col style=""/><col style=""/><col style="background-color: #dedede"/><col style="background-color: #c0c0c0"/><col style="background-color: #c0c0c0"/>
<col style="width: 75px"/>
</colgroup>
<tbody>
<tr><th></th>
<th colspan="6">Février 2015</th><th colspan="31">Mars 2015</th><th colspan="5"><acronym title="Avril 2015">A</acronym></th><th></th></tr>
<tr><td></td> <td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td><td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td><td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td><td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td><td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td><td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td>
<td></td></tr>
<tr><td></td> <td><b>23</b></td><td><b>24</b></td><td><b>25</b></td><td><b>26</b></td><td><b>27</b></td><td><b>28</b></td><td><b>01</b></td><td><b>02</b></td><td><b>03</b></td><td><b>04</b></td><td><b>05</b></td><td><b>06</b></td><td><b>07</b></td><td><b>08</b></td><td><b>09</b></td><td><b>10</b></td><td><b>11</b></td><td><b>12</b></td><td><b>13</b></td><td><b>14</b></td><td><b>15</b></td><td><b>16</b></td><td><b>17</b></td><td><b>18</b></td><td><b>19</b></td><td><b>20</b></td><td><b>21</b></td><td><b>22</b></td><td><b>23</b></td><td><b>24</b></td><td><b>25</b></td><td><b>26</b></td><td><b>27</b></td><td><b>28</b></td><td><b>29</b></td><td><b>30</b></td><td><b>31</b></td><td><b>01</b></td><td><b>02</b></td><td><b>03</b></td><td><b>04</b></td><td><b>05</b></td>
<td></td></tr>
<tr>
<td class="tlLeft"><a target="_blank" href="http://localhost:8080/config/GardesUser1350721915326376433960017169/view?page=preferences"><acronym title="Barbason Alain">AB</acronym></a></td>
<td style="background-color: #E5B620"></td>
<td style="background-color: #E5B620"></td>
<td style="background-color: #E5B620"></td>
<td></td>
<td style="background-color: #E5B620"></td>
<td style="background-color: #E5B620"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td style="background-color: #13751F"></td>
<td style="background-color: #13751F"></td>
<td></td>
<td></td>
<td title="Congé (AM), Congrès (PM)" style="background-image: url(http://localhost:8080/ui/angled.png)"></td>
<td></td>
<td></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="tlRight"><a target="_blank" href="http://localhost:8080/config/GardesUser1350721915326376433960017169/view?page=preferences"><acronym title="Barbason Alain">AB</acronym></a></td>
</tr><tr>
<td class="tlLeft"><a target="_blank" href="http://localhost:8080/config/GardesUser1350721915119231834005028903/view?page=preferences"><acronym title="Blom-Peters Lucien">LB</acronym></a></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td style="background-color: #d08181"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="tlRight"><a target="_blank" href="http://localhost:8080/config/GardesUser1350721915119231834005028903/view?page=preferences"><acronym title="Blom-Peters Lucien">LB</acronym></a></td>
</tr>
</tbody>
<tbody id="configabsences_trs">
<script>new AjaxData('configabsences_trs', 'absences:pxTotalRowsFromAjax', {}, 'configabsences')</script>
<tr>
<td class="tlLeft">
<acronym title="Nombre de travailleurs disponibles"><b>P</b></acronym></td>
<td>42</td><td>42</td><td>41</td><td>42</td><td>41</td><td>39</td><td>40</td><td>42</td><td>41</td><td>41</td><td>41</td><td>42</td><td>37</td><td>37</td><td>41</td><td>42</td><td>40</td><td>39</td><td>39</td><td>37</td><td>37</td><td>39</td><td>37</td><td>36</td><td>36</td><td>36</td><td>31</td><td>32</td><td>38</td><td>39</td><td>39</td><td>39</td><td>38</td><td>37</td><td>37</td><td>42</td><td>41</td><td>41</td><td>41</td><td>42</td><td>33</td><td>33</td>
<td class="tlRight">
<acronym title="Nombre de travailleurs disponibles"><b>P</b></acronym></td>
</tr><tr>
<td class="tlLeft">
<acronym title="Nombre total de travailleurs"><b>T</b></acronym></td>
<td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td><td>46</td>
<td class="tlRight">
<acronym title="Nombre total de travailleurs"><b>T</b></acronym></td>
</tr>
</tbody>
<tbody>
<tr><td></td>
<td><b>23</b></td><td><b>24</b></td><td><b>25</b></td><td><b>26</b></td><td><b>27</b></td><td><b>28</b></td><td><b>01</b></td><td><b>02</b></td><td><b>03</b></td><td><b>04</b></td><td><b>05</b></td><td><b>06</b></td><td><b>07</b></td><td><b>08</b></td><td><b>09</b></td><td><b>10</b></td><td><b>11</b></td><td><b>12</b></td><td><b>13</b></td><td><b>14</b></td><td><b>15</b></td><td><b>16</b></td><td><b>17</b></td><td><b>18</b></td><td><b>19</b></td><td><b>20</b></td><td><b>21</b></td><td><b>22</b></td><td><b>23</b></td><td><b>24</b></td><td><b>25</b></td><td><b>26</b></td><td><b>27</b></td><td><b>28</b></td><td><b>29</b></td><td><b>30</b></td><td><b>31</b></td><td><b>01</b></td><td><b>02</b></td><td><b>03</b></td><td><b>04</b></td><td><b>05</b></td>
<td></td></tr>
<tr><td></td>
<td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td><td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td><td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td><td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td><td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td><td><b>L</b></td><td><b>M</b></td><td><b>M</b></td><td><b>J</b></td><td><b>V</b></td><td><b>S</b></td><td><b>D</b></td>
<td></td></tr>
<tr><th></th>
<th colspan="6">Février 2015</th><th colspan="31">Mars 2015</th><th colspan="5"><acronym title="Avril 2015">A</acronym></th><th></th></tr>
</tbody>
</table>
'''

View file

@ -0,0 +1,10 @@
trueCondition = True
falseCondition = False
class O:
def __init__(self, v):
self.v = v
self.vv = v+v
oooo = [O('a'), O('b'), O('c'), O('d')]

View file

@ -0,0 +1 @@
# This file is really empty.

View file

@ -0,0 +1,2 @@
old = 'OLD'
new = 'NEW'

View file

@ -0,0 +1,6 @@
import os.path
import appy
def getFileHandler():
return file('%s/pod/test/templates/NoPython.odt' % os.path.dirname(appy.__file__))

View file

@ -0,0 +1,17 @@
class Student:
def __init__(self, **kwargs):
for k, v in kwargs.items():
setattr(self, k, v)
students = [
Student(parent_guardian='Parent 1', street='Street 1', city='Flawinne',
state='Namur', zip='5020', lname='Name 1', fname='First name 1'),
Student(parent_guardian='Parent 2', street='Street 2', city='Flawinne',
state='Namur', zip='5020', lname='Name 2', fname='First name 2'),
Student(parent_guardian='Parent 3', street='Street 3', city='Flawinne',
state='Namur', zip='5020', lname='Name 3', fname='First name 3'),
Student(parent_guardian='Parent 4', street='Street 4', city='Flawinne',
state='Namur', zip='5020', lname='Name 4', fname='First name 4'),
Student(parent_guardian='Parent 5', street='Street 5', city='Flawinne',
state='Namur', zip='5020', lname='Name 5', fname='First name 5'),
]

View file

@ -0,0 +1,3 @@
from appy.pod.test.contexts import Group
groups = [Group('group1'), Group('group2'), Group('toto')]

View file

@ -0,0 +1,6 @@
import os.path
import appy
def getAppyPath():
return os.path.dirname(appy.__file__)

View file

@ -0,0 +1,4 @@
data = [ \
['1', 2, 'three'],
['A', 'BB', 'CCC']
]

View file

@ -0,0 +1,3 @@
expr1 = 'hello'
i1 = 45
f1 = 78.05

View file

@ -0,0 +1,6 @@
import os.path
import appy
def getAppyPath():
return os.path.dirname(appy.__file__)

View file

@ -0,0 +1,4 @@
from appy.pod.test.contexts import Person
persons = [Person('P1'), Person('P2'), Person('P3'), Person('P4'),
Person('P5'), Person('P6'), Person('P7'), Person('P8')]

View file

@ -0,0 +1,3 @@
from appy.pod.test.contexts import Person
persons = [Person('P1'), Person('P2'), Person('P3'), Person('P4')]

View file

@ -0,0 +1,3 @@
from appy.pod.test.contexts import Person
persons = [Person('P1'), Person('P2'), Person('P3')]

View file

@ -0,0 +1,3 @@
from appy.pod.test.contexts import Person
persons = [Person('P1'), Person('P2')]

View file

@ -0,0 +1 @@
list1 = []

View file

@ -0,0 +1 @@
list1 = ['Hello', 'World', 45, True]

View file

@ -0,0 +1,3 @@
from appy.pod.test.contexts import Person
persons = [Person('Mr 1'), Person('Ms One'), Person('Misss two')]

View file

@ -0,0 +1 @@
c1 = False

View file

@ -0,0 +1 @@
c1 = True

View file

@ -0,0 +1,2 @@
IWillTellYouWhatInAMoment = 'return'
beingPaidForIt = True

View file

@ -0,0 +1,2 @@
var1 = 'VAR1 not overridden'
var2 = 'VAR2 not overridden'

View file

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<p>Te<b>s</b>t1 : <b>bold</b>, i<i>tal</i>ics, exponent<sup>34</sup>, sub<sub>45</sub>.</p>
<p>An <a href="http://www.google.com">hyperlink</a> to Google.</p>
<ol><li>Number list, item 1</li>
<ol><li>Sub-item 1</li><li>Sub-Item 2</li>
<ol><li>Sub-sub-item A</li><li>Sub-sub-item B <i>italic</i>.</li></ol>
</ol>
</ol>
<ul><li>A bullet</li>
<ul><li>A sub-bullet</li>
<ul><li>A sub-sub-bullet</li></ul>
<ol><li>A sub-sub number</li><li>Another.<br /></li></ol>
</ul>
</ul>
<h2>Heading<br /></h2>
Heading Blabla.<br />
<h3>SubHeading</h3>
Subheading blabla.<br />
'''
# I need a class.
class D:
def getAt1(self):
return xhtmlInput
dummy = D()

View file

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<div><strong>Programmes FSE Convergence et Compétitivité
régionale et emploi.</strong></div>'''
xhtmlInput2 = '''<b>Walloon entreprises, welcome !</b><br/>
<br/>
This site will allow you to get simple answers to those questions:<br/>
- am I an SME or not ?<br/>
- to which incentives may I postulate for, in Wallonia, according to my size?
<br/>The little test which you will find on this site is based on the European
Recommendation of May 6th, 2003. It was enforced on January 1st, 2005.
Most of the incentives that are available for SMEs in Wallonia are based
on the SME definition proposed by this recommandation.<br/><br/>
Incentives descriptions come from the
<a href="http://economie.wallonie.be/" target="_blank">MIDAS</a>
database and represent all incentives that are available on the Walloon
territory, whatever public institution is proposing it.<br/><br/>
<b>Big enterprises, do not leave !</b><br/><br/>
If this sites classifies you as a big enterprise, you will be able to consult
all incentives that are targeted to you.'''
xhtmlInput3 = '''
<div><strong>Programmes A</strong></div>
<div>Programmes B</div>
<div><strong>Programmes C</strong></div>
<ul><li>a</li><li>b</li></ul>'''

View file

@ -0,0 +1,95 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<ol><li>
<p>Test du champ kupu<br />A la ligne
1, j'y suis</p>
<ol><li>
<p>Ligne 1 de 1<br />A la ligne 1 de 1
fdsfds fsd fsd fksdf sdfs dfd sfsd fsd fsd fdsf dsfds fsdfa azra
zeeamr earkl kfl flks dlfksd lfklsd fklmsdfkl dskflmdsk flmsdf
lmdsflm dflsdfs fksd fmlsd flmdsk flmdsf mlsfkmls<br />A la ligne 2
de 1 cds fdsn sfd dsjfl dsjfhjds fhjdsf lqdhf klsfql kjfk jfkj
qfklmqds fjdlksqfj kdlfj klqfk qfjk ljfqklq djfklqjf qfk jkfljqd
sklfjqdklfjqdkl fjdqklf jdqlkfj qfq</p>
</li><li>
<p>Ligne 2 de 1<br />A la ligne 1 de 2
fdsfds fsd fsd fksdf sdfs dfd sfsd fsd fsd fdsf dsfds fsdfa azra
zeeamr earkl kfl flks dlfksd lfklsd fklmsdfkl dskflmdsk flmsdf
lmdsflm dflsdfs fksd fmlsd flmdsk flmdsf mlsfkmls<br />A la ligne 2
de 2 cds fdsn sfd dsjfl dsjfhjds fhjdsf lqdhf klsfql kjfk jfkj
qfklmqds fjdlksqfj kdlfj klqfk qfjk ljfqklq djfklqjf qfk jkfljqd
sklfjqdklfjqdkl fjdqklf jdqlkfj qf</p>
</li></ol>
</li><li>
<p>Ligne 2 tout court</p>
<ol><li>
<p>Ligne bullet dg fg dgd fgdf gdfg
dgq fg fgfq gfqd gfqg qfg qgkqlglk lgkl fkgkfq lmgkl mfqfkglmfk
gmlqf gmlqfgml kfmglk qmglk qmlgk qmlgkqmflgk qmlqg fmdlmslgk
mlsgml fskfmglk gmlkflmg ksfmlgk mlsgk</p>
</li><li>
<p>dsfl kqfs dmflm dsfsdf lskfmls
dkflmsdkf sdlmkf dslmfk sdmlfksd mlfksdmfl ksflmksdflmd slfmskd
lsmlfk mlsdfkl mskfmlsfk lmskfsfs</p>
</li><li>
<p>fmlsdm ùfkùds fldsf ùsfsdmfù
mdsfù msdùfms</p>
</li><li>
<p>fds fsd fdsf sdfds fsmd fmjdfklm
sdflmkd lfqlmklmdsqkflmq dskflmkd slmgkqdfmglklfmgksmldgk
dmlsgdkdlm fgkmdl fkgdmlfsgk mlfgksmdl fgkmldsf klmmdfkg mlsdfkgml
skfdgml skgmlkfd smlgksd mlkgml kml</p>
</li><li>
<p>lgd ksmlgjk mlsdfgkml sdfkglm
kdsfmlgk dlmskgsldmgk lms</p>
</li></ol>
</li><li>
<p>Ligne 3 tout court</p>
</li></ol>
<br />'''
xhtmlInput2 = '''
<ol start="1"><li>Le Gouvernement approuve la réaffectation de 20.056.989 attribués dans le cadre du CRAC II et laffectation du solde de 20.855.107 du solde des CRAC Ibis et II au sein du secteur des hôpitaux de lenveloppe de financement alternatif pour un montant total de 40.921.096 , au bénéfice des établissements suivants :<br /><br /></li>
<table align="center">
<tbody>
<tr>
<td>
<b>Etablissement</b></td>
<td>
<p align="center" style="text-align: center;"><b>CRAC II Phase II</b></p>
</td>
</tr>
<tr>
<td>
<p>C.H. Chrétien Liège</p>
</td>
<td nowrap="-1">
<p align="center" style="text-align: center;">11.097.377</p>
</td>
</tr>
<tr>
<td nowrap="-1">
<p>Hôp. St-Joseph, Ste-Thérèse et IMTR Gilly</p>
</td>
<td nowrap="-1">
<p align="center" style="text-align: center;">8.297.880</p>
</td>
</tr>
</tbody>
</table>
<br /><li>Il prend acte des décisions du Ministre de la Santé relatives à loctroi de la règle de 10/90 pour la subsidiation des infrastructures des établissements concernés.<br /></li>
<li>Le Gouvernement charge le Ministre de la Santé dappliquer, le cas échéant, les nouveaux plafonds à la construction visés dans larrêté ministériel du 11 mai 2007 fixant le coût maximal pouvant être pris en considération pour loctroi des subventions pour la construction de nouveaux bâtiments, les travaux dextension et de reconditionnement dun hôpital ou dun service, aux demandes doctroi de subventions antérieures au 1<sup>er</sup> janvier 2006, pour autant que ces demandes doctroi de subventions naient pas encore donné lieu à lexploitation à cette même date.<br /></li>
<li>Il charge le Ministre de la Santé de lexécution de la présente décision</li></ol>
<p></p>
'''
xhtmlInput3 = '''
<ol><li>Le Gouvernement l'exercice 2008.</li><li>Il approuve 240.000€ de007-2008.</li><li>Le Gouvernement approuve:
<ul><li>le projet d'arrêté ministériel 008;</li><li>le projet d'arrêté ministériel mique 2008-2009.</li></ul></li><li>Le Gouvernement charge le Ministre de l'Economie de l'exécution de la présente décision.</li></ol>
'''
xhtmlInput4 = '''
<div><strong>Programmes FSE Convergence et Compétitivité régionale et emploi.</strong></div>
<div><strong>Axe 1, mesure 1, et Axe 2, mesures 2, 3, 4 et 5 : formation.</strong></div>
<div><strong>Portefeuille de projets « Enseignement supérieur - Formation continue ».</strong></div>
'''

View file

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<p>Champ FCK</p>
<ol>
<li>aaaa
<ol>
<li>Azerty</li>
<li>aaaa</li>
</ol>
</li>
<li>edzfrgh</li>
<li>Kupu</li>
</ol>
<table cellspacing="1" cellpadding="1" border="1" style="width: 210px; height: 66px;">
<tbody>
<tr>
<td>a</td>
<td>b</td>
</tr>
<tr>
<td>x</td>
<td>vvv</td>
</tr>
<tr>
<td>bbb</td>
<td>vvvvv</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p style="margin-left: 40px;">hghdghghgh</p>
<ul>
<li>aaa</li>
<li>&nbsp;</li>
<li>bvbb</li>
</ul>
<ol>
<li>regrg</li>
<li>&nbsp;</li>
</ol>
<p>vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù&nbsp; vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù</p>
<p>&nbsp;</p>
<p>vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù&nbsp; vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@èù vghriqghrghgfd&nbsp; hgkll hgjkf lghjfkd slhgjfd klhgjfds klghjfds s&amp;é@</p>
'''

View file

@ -0,0 +1,60 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<p>desc 2611-03</p>
<p><br /></p>
<blockquote>
<p>identation 1</p>
<p>identation 2</p>
<p>identation 3</p>
</blockquote>
<p><br /></p>
<ol><li>point numéroté 1</li>
<ol><li>point numéroté 1.1</li><li>point numéroté 1.2</li></ol>
<li>point numéroté 2</li>
<ol><li>point numéroté 2.1</li><li>point numéroté 2.2</li><li>point numéroté 2.3</li>
<ol><li>point numéroté 2.3.1</li><li>point numéroté 2.3.2</li></ol>
</ol>
<li>point numéroté 3</li></ol>
<br />
<ul><li>grosse lune niveau 1</li>
<ul><li>grosse lune niveau 2</li>
<ul><li>grosse lune niveau 3</li>
<ul><li>grosse lune niveau 4<br /></li></ul>
</ul>
</ul>
</ul>
<ul>
<ul>
<ul>
<ul>
<ul><li>grosse lune niveau 5<br /></li>
<ul><li>grosse lune niveau 6<br /></li>
<ul><li>grosse lune niveau 7</li>
<ul><li>grosse lune niveau 8</li>
<ul><li>grosse lune niveau 9</li>
<ul><li>grosse lune niveau 10</li></ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
<br /><br />
<dl><dt>titre liste 1 </dt><dd>liste 1 </dd><dt>titre liste 2 </dt><dd>liste 2 </dd><dt>titre liste 3 </dt><dd>liste 3 </dd><dt>
<div align="center"><b>texte normal<br /></b></div>
</dt></dl>
<ol type="I"><li>romain maj 1</li><li>romain maj 2</li></ol>
<br />
<ol type="i"><li>romain 1</li><li>romain 2<br /></li></ol>
<dl>
<dl><dt><br /></dt></dl>
</dl>
<ol type="A"><li>alpha maj 1<br /></li><li>alpha maj 2</li></ol>
<br />
<ol type="a"><li>alpha min 1</li><li>alpha min 2</li></ol>
<br />blablabla<br />
<dl><dt><br /></dt></dl>
'''

View file

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
xhtmlInput = '<div class="document">\n<p>Hallo?</p>\n</div>\n'

View file

@ -0,0 +1,13 @@
xhtmlInput = '''
<div class="document">
<p>Some <strong>bold</strong> and some <em>italic</em> text.</p>
<p>A new paragraph.</p>
<p>A list with three items:</p>
<ul>
<li>the first item</li>
<li>another item</li>
<li>the last item</li>
</ul>
<p>A last paragraph.</p>
</div>
'''

View file

@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<ol><li>
<div style="text-align: justify;">Le Gouvernement adopte le projet darrêté modifiant l'arrêté du 9 février 1998 portant délégations de compétence et de signature aux fonctionnaires généraux et à certains autres agents des services du Gouvernement de la Communauté française - Ministère de la Communauté française.</div>
</li><li>
<div style="text-align: justify;">Il charge le Ministre de la Fonction publique de l'exécution de la présente décision.</div>
</li></ol>
<p class="pmParaKeepWithNext">&nbsp;</p>
'''

View file

@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<p>
<table class="plain">
<thead>
<tr>
<th class="align-right" align="right">Title column one<br /></th>
<th>title column two</th>
</tr>
</thead>
<tbody>
<tr>
<td class="align-right" align="right">Hi with a <a class="generated" href="http://easi.wallonie.be">http://easi.wallonie.be</a> <br /></td>
<td>fdff</td>
</tr>
<tr>
<td class="align-right" align="right"><br /></td>
<td><br /></td>
</tr>
<tr>
<td class="align-right" align="left">Some text here<br />
<ul><li>Bullet One</li><li>Bullet Two</li>
<ul><li>Sub-bullet A</li><li>Sub-bullet B</li>
<ul><li>Subsubboulette<br /></li></ul>
</ul>
</ul>
</td>
<td>
<table>
<tbody>
<tr>
<td>SubTable</td>
<td>Columns 2<br /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br /></p>
'''
xhtmlInput2 = '''
<ul><li>
<p>a</p>
</li><li>
<p>b</p>
</li><li>
<p>c</p>
</li>
<ul>
<li><p>SUB</p>
</li>
</ul>
</ul>
'''

View file

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<p>Some HTML entities: é: &eacute;, è: &egrave;, Atilde: &Atilde;.</p>
<p>XML entities: amp: &amp;, quote: &quot;, apos: &apos;, lt: &lt;, gt: &gt;.</p>
<p>&nbsp;</p><p>Para</p>'''

View file

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
# I need a class.
class D:
def getAt1(self):
return '''
<p>Notifia</p>
<ol>
<li>Een</li>
<li>Een</li>
<li>Een</li>
<li class="podItemKeepWithNext">Keep with next, without style mapping.</li>
<li>Een</li>
<li>Een</li>
<li>Een</li>
<li>Een</li>
<li>Een</li>
<li>Een</li>
<li>Een</li>
<ul><li class="pmItemKeepWithNext">This one has 'keep with next'</li>
<li>Hello</li>
<ol><li>aaaaaaaaaa aaaaaaaaaaaaaa</li>
<li>aaaaaaaaaa aaaaaaaaaaaaaa</li>
<li>aaaaaaaaaa aaaaaaaaaaaaaa</li>
<li class="pmItemKeepWithNext">This one has 'keep with next'</li>
</ol>
</ul>
<li>Een</li>
<li>Een</li>
<li>Een</li>
<li>Een</li>
<li>Een</li>
<li>Een</li>
<li class="pmItemKeepWithNext">This one has 'keep with next'</li>
</ol>
<ul>
<li>Un</li>
<li>Deux</li>
<li>Trois</li>
<li>Quatre</li>
<li class="pmItemKeepWithNext">VCinq (this one has 'keep with next')</li>
<li class="pmItemKeepWithNext">Six (this one has 'keep with next')</li>
<li class="pmItemKeepWithNext">Sept (this one has 'keep with next')</li>
</ul>'''
dummy = D()

View file

@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# I need a class.
class D:
def getAt1(self):
return '\n<p>Test1<br /></p>\n'
dummy = D()

View file

@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<p>Hello.</p>
<h2>Heading One</h2>
Blabla.<br />
<h3>SubHeading then.</h3>
Another blabla.<br /><br /><br /> '''
# I need a class.
class D:
def getAt1(self):
return xhtmlInput
dummy = D()

View file

@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<p>Hello.</p>
<h2>Heading One</h2>
Blabla.<br />
<h3>SubHeading then.</h3>
Another blabla.<br /><br /><br /> '''
# I need a class.
class D:
def getAt1(self):
return xhtmlInput
dummy = D()

View file

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<p>Table test.</p>
<p>
<table class="plain">
<tbody>
<tr>
<td>Table 1 <br /></td>
<td colspan="2">aaaaa<br /></td>
</tr>
<tr>
<td>zzz <br /></td>
<td>
<table>
<tr>
<td>SubTableA</td>
<td>SubTableB</td>
</tr>
<tr>
<td>SubTableC</td>
<td>SubTableD</td>
</tr>
</table>
</td>
<td><b>Hello</b> blabla<table><tr><td>SubTableOneRowOneColumn</td></tr></table></td>
</tr>
<tr>
<td><p>Within a <b>para</b>graph</p></td>
<td><b>Hello</b> non bold</td>
<td>Hello <b>bold</b> not bold</td>
</tr>
</tbody>
</table>
</p>
<br />'''

View file

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
xhtmlInput = '''
<p><meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8" /><title></title><meta name="GENERATOR" content="OpenOffice.org 3.0 (Win32)" /><style type="text/css">
&lt;!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
--&gt;
</style>
<p>concepteurs de normes : membres des
cabinets ministériels et les administrations.</p>
<p><br /><br /></p>
<p>Laurent, membre du cabinet du Ministre
de l'énergie, doit rédiger un arrêté du Gouvernement wallon
relatif à l'octroi d'une prime à l'isolation. Il peut télécharger
le canevas typ</p>
</p>'''

View file

@ -0,0 +1,18 @@
# Here I define some classes that will be used for defining objects in several
# contexts.
class Person:
def __init__(self, name):
self.name = name
self.lastName = '%s last name' % name
self.firstName = '%s first name' % name
self.address = '%s address' % name
class Group:
def __init__(self, name):
self.name = name
if name == 'group1':
self.persons = [Person('P1'), Person('P2'), Person('P3')]
elif name == 'group2':
self.persons = [Person('RA'), Person('RB')]
else:
self.persons = []

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more