Skip to content

Commit e6caaac

Browse files
author
Ram Rachum
committed
-
1 parent 44719f5 commit e6caaac

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

garlicsim/docs/ref/simpack-api.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,20 @@ This is useful because it allows GarlicSim to detect if a simulation has
161161
reached a repititive state, so it can stop the crunching right there and
162162
avoid 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
169169
deterministic.
170170

171171
Example::
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

garlicsim/garlicsim/bootstrap/bootstrap_py2exe/__init__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
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

817
import sys
@@ -11,8 +20,9 @@
1120

1221
if 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

misc/testing/zip/make_zip.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
because it will cause Python to raise an `ImportError` under Windows XP.
1717
'''
1818

19-
# blocktodo: should work with python 3, try it
20-
2119
from __future__ import with_statement
2220

2321
import sys

0 commit comments

Comments
 (0)