ndecorators = len(node.decorators.nodes)
else:
ndecorators = 0
-
+
gen = self.FunctionGen(node, self.scopes, isLambda,
self.class_name, self.get_module())
walk(node.code, gen)
"""Given the name of a tk named font, returns a Font representation.
"""
return Font(name=name, exists=True)
-
+
class Font:
"""Represents a named font.
slant -- font slant: ROMAN, ITALIC
underline -- font underlining: false (0), true (1)
overstrike -- font strikeout: false (0), true (1)
-
+
"""
def _set(self, kw):
root.tk.call("font", "configure", self.name, *font)
else:
# create new font (raises TclError if the font exists)
- root.tk.call("font", "create", self.name, *font)
+ root.tk.call("font", "create", self.name, *font)
self.delete_font = True
# backlinks!
self._root = root
self._call("font", "delete", self.name)
except (AttributeError, Tkinter.TclError):
pass
-
+
def copy(self):
"Return a distinct copy of the current font"
return Font(self._root, **self.actual())
# Generated by h2py from /usr/include/netinet/in.h
# Included from sys/cdefs.h
-def __P(protos): return protos
+def __P(protos): return protos
-def __STRING(x): return #x
+def __STRING(x): return #x
-def __XSTRING(x): return __STRING(x)
+def __XSTRING(x): return __STRING(x)
-def __P(protos): return ()
+def __P(protos): return ()
def __STRING(x): return "x"
bits = ['/'] + filename.split('/')[1:]
else:
bits = filename.split('/')
-
+
for i in range(2, len(bits)+1):
component = join(*bits[0:i])
# Resolve symbolic links.
return abspath(join(*([component] + bits[i:])))
else:
newpath = join(*([resolved] + bits[i:]))
- return realpath(newpath)
+ return realpath(newpath)
return abspath(filename)
-
+
def _resolve_link(path):
"""Internal helper function. Takes a path and follows symlinks
if nl_radixchar != li_radixchar:
print "%r != %r" % (nl_radixchar, li_radixchar)
if not saw_locale:
- raise ImportError, "None of the listed locales found"
+ raise ImportError, "None of the listed locales found"
finally:
setlocale(LC_NUMERIC, oldlocale)
def test_realpath(self):
self.assert_("foo" in realpath("foo"))
self.assertRaises(TypeError, posixpath.realpath)
-
+
if hasattr(os, "symlink"):
def test_realpath_basic(self):
# Basic operation.
self.assertEqual(realpath(ABSTFN), ABSTFN+"1")
finally:
self.safe_remove(ABSTFN)
-
+
def test_realpath_symlink_loops(self):
# Bug #930024, return the path unchanged if we get into an infinite
# symlink loop.
self.safe_remove(ABSTFN+"1")
self.safe_remove(ABSTFN+"2")
- def test_realpath_resolve_parents(self):
+ def test_realpath_resolve_parents(self):
# We also need to resolve any symlinks in the parents of a relative
# path passed to realpath. E.g.: current working directory is
# /usr/doc with 'doc' being a symlink to /usr/share/doc. We call
import zlib
except ImportError:
zlib = None
-
+
import zipfile, os, unittest
from StringIO import StringIO