File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed
garlicsim/bootstrap/bootstrap_py2exe Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -161,15 +161,20 @@ This is useful because it allows GarlicSim to detect if a simulation has
161161reached a repititive state, so it can stop the crunching right there and
162162avoid wasting resources. (Still not implemented, sorry.)
163163
164- Note that this function does not return `True` or `False`: It returns a
165- ``DeterminismSetting`` class, from the
164+ Note that this function does not return :data: `True` or :data: `False`: It
165+ returns a ``DeterminismSetting`` class, from the
166166:mod:`garlicsim.misc.settings_constants.settings` module.
167167
168- The function will return `None` if it's unknown whether the step profile is
168+ The function will return :data: `None` if it's unknown whether the step profile is
169169deterministic.
170170
171171Example::
172172
173173 def DETERMINISM_FUNCTION(step_profile):
174- if step_profile.step_function = State.step:
175- if step_profile
174+ if step_profile.step_function == State.step:
175+ if step_profile.randomness == 0:
176+ return garlicsim.misc.settings_constants.DETERMINISTIC
177+ else:
178+ return garlicsim.misc.settings_constants.UNDETERMINISTIC
179+ else:
180+ return None
Original file line number Diff line number Diff line change 22# This program is distributed under the LGPL2.1 license.
33
44'''
5+ Package for bootstrapping `garlicsim` when frozen by py2exe.
56
7+ This runs a bundled version of Python's `site` module, which adds things like
8+ `help` to `__builtins__`. This is useful because py2exe has problems with
9+ packaging the standard `site` module.
10+
11+ The `python26_site` module in this package is simply the `site` module from
12+ Python 2.6's standard library; if you want to package `garlicsim` with py2exe
13+ for a different version of Python, this package will need to be expanded with
14+ that version's `site` module.
615'''
716
817import sys
1120
1221if frozen :
1322 if sys .version_info [:2 ] != (2 , 6 ):
14- raise NotImplementedError ('For Python versions other than 2.6 need to '
15- 'bundle their respective `site.py` modules.' )
23+ raise NotImplementedError ('For Python versions other than 2.6, this '
24+ 'package needs to be expanded to have a '
25+ 'copy of their `site` module. ' )
1626 assert 'site' not in sys .modules
1727 from . import python26_site
1828
Original file line number Diff line number Diff line change 1616because it will cause Python to raise an `ImportError` under Windows XP.
1717'''
1818
19- # blocktodo: should work with python 3, try it
20-
2119from __future__ import with_statement
2220
2321import sys
You can’t perform that action at this time.
0 commit comments