]> gitweb.factorcode.org Git - factor.git/commitdiff
python: change to py-initialize in startup-hook and py-finalize in shutdown hook.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 6 Jul 2014 17:18:27 +0000 (10:18 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 6 Jul 2014 17:18:27 +0000 (10:18 -0700)
extra/python/python-docs.factor
extra/python/python-tests.factor
extra/python/python.factor

index 0da1d312f99845b98f0f5d54e366e4795a03df3c..a32bbe50431342bfc73d808a955eddd6d68704fb 100644 (file)
@@ -13,7 +13,7 @@ HELP: >py
 { $examples
   { $example
     "USING: arrays prettyprint python sequences ;"
-    "py-initialize 10 iota >array >py py> ."
+    "10 iota >array >py py> ."
     "{ 0 1 2 3 4 5 6 7 8 9 }"
   }
 }
index 4fbb29ec385047ff501e3350a297678c88201517..582e6bfe0c3867c23015194f8a07e1a73a9b2ae3 100644 (file)
@@ -2,8 +2,6 @@ USING: accessors arrays assocs calendar continuations destructors fry kernel
 math namespaces python python.ffi python.objects sequences strings tools.test ;
 IN: python
 
-py-initialize
-
 : py-test ( result quot -- )
     '[ _ with-destructors ] unit-test ; inline
 
index 0f7695db7063c14a2c4e56259d3bab38af93202f..c40840c9c5339f10f60af33a7ce4933c691111ab 100644 (file)
@@ -1,6 +1,7 @@
-USING: accessors alien alien.c-types alien.data alien.strings arrays assocs
-command-line fry hashtables io.encodings.utf8 kernel namespaces python.errors
-python.ffi python.objects sequences specialized-arrays strings vectors ;
+USING: alien.c-types alien.data arrays assocs command-line fry
+hashtables init io.encodings.utf8 kernel namespaces
+python.errors python.ffi python.objects sequences
+specialized-arrays strings vectors ;
 IN: python
 QUALIFIED: math
 
@@ -96,3 +97,6 @@ ERROR: missing-type type ;
 : py> ( py-obj -- obj )
     dup "__class__" getattr "__name__" getattr PyString_AsString
     py-type-dispatch get ?at [ call( x -- x ) ] [ missing-type ] if ;
+
+[ py-initialize ] "py-initialize" add-startup-hook
+[ py-finalize ] "py-finalize" add-shutdown-hook