mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Get rid of the __all__ directive.
Everywhere except kivy.
This commit is contained in:
parent
91ef11b7ac
commit
a54b603911
4 changed files with 29 additions and 83 deletions
|
@ -113,27 +113,6 @@ __revision__ = '$Id: configobj.py 156 2006-01-31 14:57:08Z fuzzyman $'
|
||||||
|
|
||||||
__docformat__ = "restructuredtext en"
|
__docformat__ = "restructuredtext en"
|
||||||
|
|
||||||
__all__ = (
|
|
||||||
'__version__',
|
|
||||||
'DEFAULT_INDENT_TYPE',
|
|
||||||
'DEFAULT_INTERPOLATION',
|
|
||||||
'ConfigObjError',
|
|
||||||
'NestingError',
|
|
||||||
'ParseError',
|
|
||||||
'DuplicateError',
|
|
||||||
'ConfigspecError',
|
|
||||||
'ConfigObj',
|
|
||||||
'SimpleVal',
|
|
||||||
'InterpolationError',
|
|
||||||
'InterpolationLoopError',
|
|
||||||
'MissingInterpolationOption',
|
|
||||||
'RepeatSectionError',
|
|
||||||
'UnreprError',
|
|
||||||
'UnknownType',
|
|
||||||
'__docformat__',
|
|
||||||
'flatten_errors',
|
|
||||||
)
|
|
||||||
|
|
||||||
DEFAULT_INTERPOLATION = 'configparser'
|
DEFAULT_INTERPOLATION = 'configparser'
|
||||||
DEFAULT_INDENT_TYPE = ' '
|
DEFAULT_INDENT_TYPE = ' '
|
||||||
MAX_INTERPOL_DEPTH = 10
|
MAX_INTERPOL_DEPTH = 10
|
||||||
|
|
|
@ -133,37 +133,6 @@ __version__ = '0.2.3'
|
||||||
|
|
||||||
__revision__ = '$Id: validate.py 123 2005-09-08 08:54:28Z fuzzyman $'
|
__revision__ = '$Id: validate.py 123 2005-09-08 08:54:28Z fuzzyman $'
|
||||||
|
|
||||||
__all__ = (
|
|
||||||
'__version__',
|
|
||||||
'dottedQuadToNum',
|
|
||||||
'numToDottedQuad',
|
|
||||||
'ValidateError',
|
|
||||||
'VdtUnknownCheckError',
|
|
||||||
'VdtParamError',
|
|
||||||
'VdtTypeError',
|
|
||||||
'VdtValueError',
|
|
||||||
'VdtValueTooSmallError',
|
|
||||||
'VdtValueTooBigError',
|
|
||||||
'VdtValueTooShortError',
|
|
||||||
'VdtValueTooLongError',
|
|
||||||
'VdtMissingValue',
|
|
||||||
'Validator',
|
|
||||||
'is_integer',
|
|
||||||
'is_float',
|
|
||||||
'is_boolean',
|
|
||||||
'is_list',
|
|
||||||
'is_ip_addr',
|
|
||||||
'is_string',
|
|
||||||
'is_int_list',
|
|
||||||
'is_bool_list',
|
|
||||||
'is_float_list',
|
|
||||||
'is_string_list',
|
|
||||||
'is_ip_addr_list',
|
|
||||||
'is_mixed_list',
|
|
||||||
'is_option',
|
|
||||||
'__docformat__',
|
|
||||||
)
|
|
||||||
|
|
||||||
INTP_VER = sys.version_info[:2]
|
INTP_VER = sys.version_info[:2]
|
||||||
if INTP_VER < (2, 2):
|
if INTP_VER < (2, 2):
|
||||||
raise RuntimeError("Python v.2.2 or later needed")
|
raise RuntimeError("Python v.2.2 or later needed")
|
||||||
|
@ -1411,7 +1380,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
By Michael Foord
|
By Michael Foord
|
||||||
|
|
||||||
Added __version__, __all__, and __docformat__
|
Added __version__, all__, and __docformat__
|
||||||
|
|
||||||
Replaced ``basestring`` with ``types.StringTypes``
|
Replaced ``basestring`` with ``types.StringTypes``
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@ http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
|
||||||
from six.moves import html_parser
|
from six.moves import html_parser
|
||||||
from formatter import AS_IS
|
from formatter import AS_IS
|
||||||
|
|
||||||
__all__ = ["HTMLParser", "HTMLParseError"]
|
|
||||||
|
|
||||||
|
|
||||||
class HTMLParseError(RuntimeError):
|
class HTMLParseError(RuntimeError):
|
||||||
"""Error raised when an HTML document can't be parsed."""
|
"""Error raised when an HTML document can't be parsed."""
|
||||||
|
|
|
@ -16,18 +16,8 @@ __version__ = "0.3"
|
||||||
|
|
||||||
__author__ = "Guilherme Polo <ggpolo@gmail.com>"
|
__author__ = "Guilherme Polo <ggpolo@gmail.com>"
|
||||||
|
|
||||||
__all__ = ["Button", "Checkbutton", "Combobox", "Entry", "Frame", "Label",
|
|
||||||
"Labelframe", "LabelFrame", "Menubutton", "Notebook", "Panedwindow",
|
|
||||||
"PanedWindow", "Progressbar", "Radiobutton", "Scale", "Scrollbar",
|
|
||||||
"Separator", "Sizegrip", "Style", "Treeview",
|
|
||||||
# Extensions
|
|
||||||
"LabeledScale", "OptionMenu",
|
|
||||||
# functions
|
|
||||||
"tclobjs_to_py"]
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from six.moves import tkinter
|
from six.moves import tkinter
|
||||||
from pysollib.mygettext import _, n_
|
|
||||||
|
|
||||||
_flatten = tkinter._flatten
|
_flatten = tkinter._flatten
|
||||||
|
|
||||||
|
@ -38,6 +28,7 @@ if sys.version_info > (3,):
|
||||||
basestring = str
|
basestring = str
|
||||||
unicode = str
|
unicode = str
|
||||||
|
|
||||||
|
|
||||||
def _loadttk(loadtk):
|
def _loadttk(loadtk):
|
||||||
# This extends the default tkinter.Tk._loadtk method so we can be
|
# This extends the default tkinter.Tk._loadtk method so we can be
|
||||||
# sure that ttk is available for use, or not.
|
# sure that ttk is available for use, or not.
|
||||||
|
@ -57,8 +48,10 @@ def _loadttk(loadtk):
|
||||||
|
|
||||||
return _wrapper
|
return _wrapper
|
||||||
|
|
||||||
|
|
||||||
tkinter.Tk._loadtk = _loadttk(tkinter.Tk._loadtk)
|
tkinter.Tk._loadtk = _loadttk(tkinter.Tk._loadtk)
|
||||||
|
|
||||||
|
|
||||||
def _format_optdict(optdict, script=False, ignore=None):
|
def _format_optdict(optdict, script=False, ignore=None):
|
||||||
"""Formats optdict to a tuple to pass it to tk.call.
|
"""Formats optdict to a tuple to pass it to tk.call.
|
||||||
|
|
||||||
|
@ -93,6 +86,7 @@ def _format_optdict(optdict, script=False, ignore=None):
|
||||||
# Remember: _flatten skips over None
|
# Remember: _flatten skips over None
|
||||||
return _flatten(opts)
|
return _flatten(opts)
|
||||||
|
|
||||||
|
|
||||||
def _format_mapdict(mapdict, script=False):
|
def _format_mapdict(mapdict, script=False):
|
||||||
"""Formats mapdict to pass it to tk.call.
|
"""Formats mapdict to pass it to tk.call.
|
||||||
|
|
||||||
|
@ -131,6 +125,7 @@ def _format_mapdict(mapdict, script=False):
|
||||||
|
|
||||||
return _flatten(opts)
|
return _flatten(opts)
|
||||||
|
|
||||||
|
|
||||||
def _format_elemcreate(etype, script=False, *args, **kw):
|
def _format_elemcreate(etype, script=False, *args, **kw):
|
||||||
"""Formats args and kw according to the given element factory etype."""
|
"""Formats args and kw according to the given element factory etype."""
|
||||||
spec = None
|
spec = None
|
||||||
|
@ -168,6 +163,7 @@ def _format_elemcreate(etype, script=False, *args, **kw):
|
||||||
|
|
||||||
return spec, opts
|
return spec, opts
|
||||||
|
|
||||||
|
|
||||||
def _format_layoutlist(layout, indent=0, indent_size=2):
|
def _format_layoutlist(layout, indent=0, indent_size=2):
|
||||||
"""Formats a layout list so we can pass the result to ttk::style
|
"""Formats a layout list so we can pass the result to ttk::style
|
||||||
layout and ttk::style settings. Note that the layout doesn't has to
|
layout and ttk::style settings. Note that the layout doesn't has to
|
||||||
|
@ -202,7 +198,8 @@ def _format_layoutlist(layout, indent=0, indent_size=2):
|
||||||
elem, opts = layout_elem
|
elem, opts = layout_elem
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
fopts = ' '.join(map(str, _format_optdict(opts, True, "children")))
|
fopts = ' '.join(map(str, _format_optdict(opts, True, "children")))
|
||||||
head = "%s%s%s" % (' ' * indent, elem, (" %s" % fopts) if fopts else '')
|
head = "%s%s%s" % (' ' * indent, elem,
|
||||||
|
(" %s" % fopts) if fopts else '')
|
||||||
|
|
||||||
if "children" in opts:
|
if "children" in opts:
|
||||||
script.append(head + " -children {")
|
script.append(head + " -children {")
|
||||||
|
@ -217,6 +214,7 @@ def _format_layoutlist(layout, indent=0, indent_size=2):
|
||||||
|
|
||||||
return '\n'.join(script), indent
|
return '\n'.join(script), indent
|
||||||
|
|
||||||
|
|
||||||
def _script_from_settings(settings):
|
def _script_from_settings(settings):
|
||||||
"""Returns an appropriate script, based on settings, according to
|
"""Returns an appropriate script, based on settings, according to
|
||||||
theme_settings definition to be used by theme_settings and
|
theme_settings definition to be used by theme_settings and
|
||||||
|
@ -227,7 +225,8 @@ def _script_from_settings(settings):
|
||||||
for name, opts in settings.items():
|
for name, opts in settings.items():
|
||||||
# will format specific keys according to Tcl code
|
# will format specific keys according to Tcl code
|
||||||
if opts.get('configure'): # format 'configure'
|
if opts.get('configure'): # format 'configure'
|
||||||
s = ' '.join(map(unicode, _format_optdict(opts['configure'], True)))
|
s = ' '.join(
|
||||||
|
map(unicode, _format_optdict(opts['configure'], True)))
|
||||||
script.append("ttk::style configure %s %s;" % (name, s))
|
script.append("ttk::style configure %s %s;" % (name, s))
|
||||||
|
|
||||||
if opts.get('map'): # format 'map'
|
if opts.get('map'): # format 'map'
|
||||||
|
@ -259,6 +258,7 @@ def _script_from_settings(settings):
|
||||||
|
|
||||||
return '\n'.join(script)
|
return '\n'.join(script)
|
||||||
|
|
||||||
|
|
||||||
def _dict_from_tcltuple(ttuple, cut_minus=True):
|
def _dict_from_tcltuple(ttuple, cut_minus=True):
|
||||||
"""Break tuple in pairs, format it properly, then build the return
|
"""Break tuple in pairs, format it properly, then build the return
|
||||||
dict. If cut_minus is True, the supposed '-' prefixing options will
|
dict. If cut_minus is True, the supposed '-' prefixing options will
|
||||||
|
|
Loading…
Add table
Reference in a new issue