[gen] CSS improvements; bugfix: parsing now works even if encoding is declared at the beginning of the Python file; a default layout for Boolean fields, including a description, is now available in Boolean.dLayouts.
This commit is contained in:
parent
ede29fb6c1
commit
e3b7f5364f
|
@ -1443,6 +1443,7 @@ class String(Type):
|
||||||
return self.getCaptchaChallenge({})['text']
|
return self.getCaptchaChallenge({})['text']
|
||||||
|
|
||||||
class Boolean(Type):
|
class Boolean(Type):
|
||||||
|
|
||||||
def __init__(self, validator=None, multiplicity=(0,1), index=None,
|
def __init__(self, validator=None, multiplicity=(0,1), index=None,
|
||||||
default=None, optional=False, editDefault=False, show=True,
|
default=None, optional=False, editDefault=False, show=True,
|
||||||
page='main', group=None, layouts = None, move=0, indexed=False,
|
page='main', group=None, layouts = None, move=0, indexed=False,
|
||||||
|
@ -1458,8 +1459,9 @@ class Boolean(Type):
|
||||||
label)
|
label)
|
||||||
self.pythonType = bool
|
self.pythonType = bool
|
||||||
|
|
||||||
|
dLayouts = {'view': 'lf', 'edit': Table('flrv;=d', width=None)}
|
||||||
def getDefaultLayouts(self):
|
def getDefaultLayouts(self):
|
||||||
return {'view': 'l;f!-', 'edit': Table('f;lrv;=', width=None)}
|
return {'view': 'lf', 'edit': Table('f;lrv;=', width=None)}
|
||||||
|
|
||||||
def getValue(self, obj):
|
def getValue(self, obj):
|
||||||
'''Never returns "None". Returns always "True" or "False", even if
|
'''Never returns "None". Returns always "True" or "False", even if
|
||||||
|
|
|
@ -79,10 +79,15 @@ class AstClass:
|
||||||
class Ast:
|
class Ast:
|
||||||
'''Python AST.'''
|
'''Python AST.'''
|
||||||
classPattern = (symbol.stmt, symbol.compound_stmt, symbol.classdef)
|
classPattern = (symbol.stmt, symbol.compound_stmt, symbol.classdef)
|
||||||
|
utf8prologue = '# -*- coding: utf-8 -*-'
|
||||||
def __init__(self, pyFile):
|
def __init__(self, pyFile):
|
||||||
f = file(pyFile)
|
f = file(pyFile)
|
||||||
fContent = f.read()
|
fContent = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
|
# For some unknown reason, when an UTF-8 encoding is declared, parsing
|
||||||
|
# does not work.
|
||||||
|
if fContent.startswith(self.utf8prologue):
|
||||||
|
fContent = fContent[len(self.utf8prologue):]
|
||||||
fContent = fContent.replace('\r', '')
|
fContent = fContent.replace('\r', '')
|
||||||
ast = parser.suite(fContent).totuple()
|
ast = parser.suite(fContent).totuple()
|
||||||
# Get all the classes defined within this module.
|
# Get all the classes defined within this module.
|
||||||
|
|
|
@ -59,9 +59,10 @@ img { border: 0; vertical-align: middle}
|
||||||
.buttons { margin-left: 4px;}
|
.buttons { margin-left: 4px;}
|
||||||
.fakeButton { border: 1px solid #D7DEE4; background-color: #fde8e0;
|
.fakeButton { border: 1px solid #D7DEE4; background-color: #fde8e0;
|
||||||
padding: 0px 8px 2px; font: italic 92% Helvetica,Arial,sans-serif}
|
padding: 0px 8px 2px; font: italic 92% Helvetica,Arial,sans-serif}
|
||||||
.message { color: #fd9c03; position: absolute; top: -55px; left: 100px;
|
.message { position: absolute; top: -40px; left: 150px; font-size: 90%;
|
||||||
width: 700px; border: 1px black dashed; padding: 2px 6px;
|
width: 600px; border: 1px #F0C36D solid; padding: 6px 16px;
|
||||||
background-color: #f4f5f6}
|
background-color: #F9EDBE; text-align: center;
|
||||||
|
border-radius: 2px 2px 2px 2px; box-shadow: 0 2px 4px #A9A9A9;}
|
||||||
.discreet { font-size: 90%; }
|
.discreet { font-size: 90%; }
|
||||||
.portlet { width: 150px; border-right: 1px solid #5F7983;}
|
.portlet { width: 150px; border-right: 1px solid #5F7983;}
|
||||||
.portletContent { margin: 9px; }
|
.portletContent { margin: 9px; }
|
||||||
|
|
Loading…
Reference in a new issue