[pypy-commit] lang-smalltalk storage-cleanups: Moved system.py and version.py to spyvm/util.

anton_gulenko noreply at buildbot.pypy.org
Wed Aug 6 11:41:11 CEST 2014


Author: Anton Gulenko <anton.gulenko at googlemail.com>
Branch: storage-cleanups
Changeset: r1017:c0050f5678f2
Date: 2014-08-05 20:06 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/c0050f5678f2/

Log:	Moved system.py and version.py to spyvm/util. Cleaned up some
	imports.

diff --git a/spyvm/model.py b/spyvm/model.py
--- a/spyvm/model.py
+++ b/spyvm/model.py
@@ -10,13 +10,10 @@
                 W_BytesObject
                 W_WordsObject
             W_CompiledMethod
-
-W_BlockContext and W_MethodContext classes have been replaced by functions
-that create W_PointersObjects of correct size with attached shadows.
 """
-import sys, weakref
-from spyvm import constants, error, version, storage_logger
-from spyvm.version import elidable_for_version, constant_for_version, constant_for_version_arg
+import sys
+from spyvm import constants, error, storage_logger
+from spyvm.util.version import constant_for_version, constant_for_version_arg, VersionMixin
 
 from rpython.rlib import rrandom, objectmodel, jit, signature
 from rpython.rlib.rarithmetic import intmask, r_uint, r_int
@@ -1032,7 +1029,7 @@
 
     lookup_selector = "<unknown>"
     lookup_class = None
-    import_from_mixin(version.VersionMixin)
+    import_from_mixin(VersionMixin)
     
     def __init__(self, space, bytecount=0, header=0):
         self.bytes = ["\x00"] * bytecount
diff --git a/spyvm/objspace.py b/spyvm/objspace.py
--- a/spyvm/objspace.py
+++ b/spyvm/objspace.py
@@ -1,7 +1,7 @@
 import os
 
-from spyvm import constants, model, model_display, wrapper, version, display
-from spyvm.error import UnwrappingError, WrappingError, PrimitiveFailedError
+from spyvm import constants, model, wrapper, display
+from spyvm.error import UnwrappingError, WrappingError
 from rpython.rlib import jit, rpath
 from rpython.rlib.objectmodel import instantiate, specialize, import_from_mixin
 from rpython.rlib.rarithmetic import intmask, r_uint, int_between
diff --git a/spyvm/storage.py b/spyvm/storage.py
--- a/spyvm/storage.py
+++ b/spyvm/storage.py
@@ -1,7 +1,7 @@
 
 import sys, weakref
-from spyvm import model, version, constants
-from spyvm.version import elidable_for_version
+from spyvm import model, constants
+from spyvm.util.version import elidable_for_version, VersionMixin
 from rpython.rlib import objectmodel, jit
 from rpython.rlib.objectmodel import import_from_mixin
 
@@ -283,7 +283,7 @@
     _immutable_fields_ = ['version?']
     _attrs_ = ['version']
     repr_classname = "AbstractCachingShadow"
-    import_from_mixin(version.VersionMixin)
+    import_from_mixin(VersionMixin)
     version = None
 
     def __init__(self, space, w_self, size):
diff --git a/spyvm/storage_classes.py b/spyvm/storage_classes.py
--- a/spyvm/storage_classes.py
+++ b/spyvm/storage_classes.py
@@ -1,7 +1,7 @@
 
-from spyvm import model, constants, error, wrapper, version
+from spyvm import model, constants, error, wrapper
 from spyvm.storage import AbstractCachingShadow, ListStorageShadow
-from spyvm.version import constant_for_version, constant_for_version_arg
+from spyvm.util.version import constant_for_version, constant_for_version_arg, Version
 from rpython.rlib import jit
 
 POINTERS = 0
@@ -231,7 +231,7 @@
         raise error.MethodNotFound()
 
     def changed(self):
-        self.superclass_changed(version.Version())
+        self.superclass_changed(Version())
 
     # this is done, because the class-hierarchy contains cycles
     def superclass_changed(self, version):
diff --git a/spyvm/test/util.py b/spyvm/test/util.py
--- a/spyvm/test/util.py
+++ b/spyvm/test/util.py
@@ -1,5 +1,5 @@
 import py, sys
-from spyvm import model, storage_classes, objspace, version, constants, squeakimage, interpreter, interpreter_bytecodes
+from spyvm import model, storage_classes, objspace, util, constants, squeakimage, interpreter, interpreter_bytecodes
 from rpython.rlib.objectmodel import instantiate
 
 # Most tests don't need a bootstrapped objspace. Those that do, indicate so explicitely.
@@ -237,7 +237,7 @@
                         name='?', format=storage_classes.POINTERS, varsized=False):
         s = instantiate(storage_classes.ClassShadow)
         s.space = self
-        s.version = version.Version()
+        s.version = util.version.Version()
         s._w_self = w_class
         s.subclass_s = {}
         s._s_superclass = None
diff --git a/spyvm/system.py b/spyvm/util/system.py
rename from spyvm/system.py
rename to spyvm/util/system.py
diff --git a/spyvm/version.py b/spyvm/util/version.py
rename from spyvm/version.py
rename to spyvm/util/version.py


More information about the pypy-commit mailing list