| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2f91f5b commit a2ac635
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,4 @@ | |||
| 1 | 1 | __version__='0.9' | |
| 2 | - __MAGIC = '_p_l_o_t_d_e_v_i_c_e_' | ||
| 3 | 2 | ||
| 4 | 3 | def get_version(): | |
| 5 | 4 | return __version__ | |
@@ -29,6 +28,9 @@ class DeviceError(Exception): | |||
| 29 | 28 | from os.path import join | |
| 30 | 29 | sys.path.append(join(getenv('HOME'), 'Library', 'Application Support', 'PlotDevice')) | |
| 31 | 30 | ||
| 31 | + # the global non-conflicting token (fingers crossed) | ||
| 32 | + DEFAULT = '_p_l_o_t_d_e_v_i_c_e_' | ||
| 33 | + | ||
| 32 | 34 | if is_windowed or in_setup: | |
| 33 | 35 | # if a script imports * from within the app/tool, nothing should be (re-)added to the | |
| 34 | 36 | # global namespace. we'll let the Sandbox handle populating the namespace instead. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | from Quartz import * | |
| 5 | 5 | from collections import namedtuple, defaultdict | |
| 6 | 6 | ||
| 7 | - from plotdevice import DeviceError | ||
| 7 | + from plotdevice import DeviceError, DEFAULT | ||
| 8 | 8 | from ..util import _copy_attrs, _copy_attr, _flatten, trim_zeroes | |
| 9 | 9 | from .colors import Color | |
| 10 | 10 | from .transform import Transform | |
@@ -308,7 +308,6 @@ def _set_dashstyle(self, *segments): | |||
| 308 | 308 | self._penstyle = self._penstyle._replace(dash=steps) | |
| 309 | 309 | dash = dashstyle = property(_get_dashstyle, _set_dashstyle) | |
| 310 | 310 | ||
| 311 | - from plotdevice import __MAGIC as DEFAULT | ||
| 312 | 311 | class StyleMixin(Grob): | |
| 313 | 312 | """Mixin class for text-styling support. | |
| 314 | 313 | Adds the stylesheet, fill, and style attributes to the class.""" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,7 @@ | |||
| 6 | 6 | from AppKit import * | |
| 7 | 7 | from Foundation import * | |
| 8 | 8 | ||
| 9 | - from plotdevice import DeviceError | ||
| 9 | + from plotdevice import DeviceError, DEFAULT | ||
| 10 | 10 | from .atoms import TransformMixin, ColorMixin, EffectsMixin, StyleMixin, BoundsMixin, Grob | |
| 11 | 11 | from . import _save, _restore, _ns_context | |
| 12 | 12 | from .transform import Transform, Region, Size | |
@@ -19,9 +19,6 @@ | |||
| 19 | 19 | __all__ = ("Text", "Family", "Font", "Stylesheet", | |
| 20 | 20 | "LEFT", "RIGHT", "CENTER", "JUSTIFY", "DEFAULT") | |
| 21 | 21 | ||
| 22 | - # hopefully non-conflicting style name for the stylesheet defaults | ||
| 23 | - from plotdevice import __MAGIC as DEFAULT | ||
| 24 | - | ||
| 25 | 22 | # text alignments | |
| 26 | 23 | LEFT = "left" | |
| 27 | 24 | RIGHT = "right" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ | |||
| 8 | 8 | from AppKit import * | |
| 9 | 9 | from ..run import stacktrace, coredump | |
| 10 | 10 | from ..lib.io import MovieExportSession, ImageExportSession | |
| 11 | - from plotdevice import util, context, gfx, DeviceError, __MAGIC as MAGICVAR | ||
| 11 | + from plotdevice import util, context, gfx, DeviceError | ||
| 12 | 12 | ||
| 13 | 13 | __all__ = ['Sandbox'] | |
| 14 | 14 | ||
@@ -53,7 +53,6 @@ def __init__(self, delegate=None): | |||
| 53 | 53 | self.session = None # the image/movie export session (if any) | |
| 54 | 54 | self.stationery = False # whether the script is from the examples folder | |
| 55 | 55 | self.delegate = None # object with exportStatus and exportProgress methods | |
| 56 | - self.magicvar = 0 # used for value ladders | ||
| 57 | 56 | ||
| 58 | 57 | # set up the graphics plumbing | |
| 59 | 58 | self.canvas = context.Canvas() | |
@@ -139,7 +138,6 @@ def compile(self, src=None): | |||
| 139 | 138 | self.namespace.update(dict(self._env)) | |
| 140 | 139 | # self.__doc__ = {} | |
| 141 | 140 | # self.namespace.update(dict( __doc__=self.__doc__, )) | |
| 142 | - self.namespace[MAGICVAR] = self.magicvar # Add the magic var | ||
| 143 | 141 | ||
| 144 | 142 | result = Outcome(True, []) | |
| 145 | 143 | if not self._code: | |
@@ -191,9 +189,6 @@ def render(self, method=None): | |||
| 191 | 189 | # Reset the context state (and bind the .gfx objects as a side-effect) | |
| 192 | 190 | self.context._resetContext() | |
| 193 | 191 | ||
| 194 | - # Initalize the magicvar | ||
| 195 | - self.namespace[MAGICVAR] = self.magicvar | ||
| 196 | - | ||
| 197 | 192 | # Set the frame/pagenum | |
| 198 | 193 | self.namespace['PAGENUM'] = self.namespace['FRAME'] = self._meta.next | |
| 199 | 194 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments