kvlang: implement root widget, add doc and rename some methods/class for consistency.

This commit is contained in:
Mathieu Virbel 2012-01-20 12:00:33 +01:00
parent 50e87d45a5
commit cbda001537
3 changed files with 173 additions and 538 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ import unittest
class InvalidLangTestCase(unittest.TestCase):
def test_invalid_childname(self):
from kivy.lang import Builder, ParserError
from kivy.lang import Builder, ParserException
from kivy.factory import FactoryException
try:
Builder.load_string('''
@ -19,13 +19,13 @@ Widget:
thecursor.Cursor:
''')
self.fail('Invalid children name')
except ParserError:
except ParserException:
pass
except FactoryException:
pass
def test_invalid_childname_before(self):
from kivy.lang import Builder, ParserError
from kivy.lang import Builder, ParserException
try:
Builder.load_string('''
Widget:
@ -38,5 +38,5 @@ Widget:
pos_hint:{'x':0.45, 'y':0.45}
''')
self.fail('Invalid children name')
except ParserError:
except ParserException:
pass

View File

@ -54,13 +54,13 @@ class LangTestCase(unittest.TestCase):
def test_loading_failed_1(self):
# invalid indent
Builder = self.import_builder()
from kivy.lang import ParserError
from kivy.lang import ParserException
try:
Builder.load_string('''#:kivy 1.0
<TestClass>:
''')
self.fail('Invalid indentation.')
except ParserError:
except ParserException:
pass
def test_parser_numeric_1(self):