MissingPy 0.10.1 → 0.10.2
raw patch · 12 files changed
+164/−70 lines, 12 filesdep ~basesetup-changed
Dependency ranges changed: base
Files
- MissingPy.cabal +3/−7
- MissingPy/AnyDBM.hs +1/−1
- MissingPy/FileArchive/BZip2.hs +1/−1
- MissingPy/FileArchive/GZip.hs +1/−1
- Python/Exceptions.hs +11/−9
- Python/Interpreter.hs +37/−9
- Python/Objects.hs +47/−9
- Python/Objects/Dict.hs +16/−9
- Python/Objects/File.hs +19/−11
- Python/Types.hs +7/−4
- Python/Utils.hs +20/−8
- Setup.hs +1/−1
MissingPy.cabal view
@@ -1,5 +1,5 @@ Name: MissingPy-Version: 0.10.1+Version: 0.10.2 License: GPL Maintainer: John Goerzen <jgoerzen@complete.org> Author: John Goerzen@@ -27,10 +27,7 @@ it. Build-Type: Custom--- Cabal-Version: >= 1.2 && < 1.3-Cabal-Version: >= 1.2-Flag splitBase- description: Choose the new smaller, split-up package+cabal-version: >= 1.6 Library Exposed-Modules: Python.Types,@@ -45,8 +42,7 @@ MissingPy.FileArchive.BZip2, MissingPy.AnyDBM Other-Modules: Python.ForeignImports- Build-Depends: base, MissingH>=1.0.1, anydbm>=1.0.5+ Build-Depends: base == 4.*, MissingH>=1.0.1, anydbm>=1.0.5 C-Sources: glue/glue.c glue/excglue.c- GHC-Options: -O2 Extensions: ForeignFunctionInterface, TypeSynonymInstances, FlexibleInstances
MissingPy/AnyDBM.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-overlapping-instances #-}+{-# LANGUAGE OverlappingInstances#-} {- arch-tag: Interface to anydbm.py Copyright (C) 2005 John Goerzen <jgoerzen@complete.org>
MissingPy/FileArchive/BZip2.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-overlapping-instances #-}+{-# LANGUAGE OverlappingInstances#-} {- arch-tag: BZip2 files Copyright (C) 2005 John Goerzen <jgoerzen@complete.org>
MissingPy/FileArchive/GZip.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-overlapping-instances #-}+{-# LANGUAGE OverlappingInstances#-} {- arch-tag: GZip files Copyright (C) 2005 John Goerzen <jgoerzen@complete.org>
Python/Exceptions.hs view
@@ -47,15 +47,17 @@ ) where -import Python.Utils-import Foreign.C.Types-import Python.Objects-import Foreign-import Python.Types-import Data.Dynamic-import Data.Typeable-import Python.Interpreter-import Python.ForeignImports+import Python.Utils (withPyObject, checkCInt)+import Python.Objects (strOf)+import Python.Types (+ excType+ , excValue+ , excFormatted+ , PyObject+ , PyException+ )+import Data.Dynamic (fromDynamic)+import Python.ForeignImports (pyErr_GivenExceptionMatches) import Control.OldException (throwDyn, catchDyn, dynExceptions, Exception) {- | Execute the given IO action.
Python/Interpreter.hs view
@@ -1,4 +1,5 @@-{-# OPTIONS -fallow-overlapping-instances #-}+{-# LANGUAGE OverlappingInstances#-}+ {- arch-tag: Python interpreter module Copyright (C) 2005 John Goerzen <jgoerzen@complete.org> @@ -52,14 +53,41 @@ ) where -import Python.Utils-import Python.Objects-import Python.Types-import Python.ForeignImports-import Foreign-import Foreign.C.String-import Foreign.C-import System.IO.Unsafe+import Python.Utils (+ checkCInt+ , getDefaultGlobals+ , withPyObject+ , fromCPyObject+ , py_incref+ , pyModule_GetDict+ , pyImport_AddModule+ )++import Python.Objects (+ toPyObject+ , noParms+ , noKwParms+ , fromPyObject+ , pyObject_Call+ , pyObject_CallHs+ , PyObject+ , ToPyObject+ , FromPyObject+ )++import Python.Types (StartFrom(..))++import Python.ForeignImports (+ cpy_initialize+ , cpyRun_String+ , cpyRun_SimpleString+ , cpyImport_ImportModuleEx+ , sf2c+ , pyImport_GetModuleDict+ , pyDict_SetItemString+ )++import Foreign.C (withCString) {- | Initialize the Python interpreter environment.
Python/Objects.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-overlapping-instances #-}+{-# LANGUAGE OverlappingInstances#-} {- arch-tag: Python type instances Copyright (C) 2005 John Goerzen <jgoerzen@complete.org>@@ -65,14 +65,52 @@ where import Python.Types import Python.Utils-import Foreign.C.Types-import Foreign.C.String-import Foreign.Ptr-import Foreign.Storable-import Foreign.Marshal.Alloc-import Data.List-import System.IO.Unsafe-import Python.ForeignImports+import Foreign.C.Types (+ CLong+ , CInt+ , CDouble+ )++import Foreign.C.String (+ withCString+ , peekCStringLen+ , CStringLen+ )+import Foreign.Ptr (nullPtr)+import Foreign.Storable (peek)+import Foreign.Marshal.Alloc (alloca)+import Python.ForeignImports (+ cpyList_AsTuple+ , cpyObject_Call+ , pyDict_New+ , pyFloat_AsDouble+ , pyFloat_FromDouble+ , pyInt_AsLong+ , pyInt_FromLong+ , pyList_Append+ , pyList_Check+ , pyList_GetItem+ , pyList_New+ , pyList_Size+ , pyLong_FromString+ , pyMapping_Items+ , pyObject_Dir+ , pyObject_GetAttrString+ , pyObject_HasAttrString+ , pyObject_Repr+ , pyObject_SetAttrString+ , pyObject_SetItem+ , pyObject_Str+ , pyObject_Type+ , pyString_AsStringAndSize+ , pyString_FromStringAndSize+ , pyTuple_Check+ , pyTuple_GetItem+ , pyTuple_Size+ )+++ {- | Members of this class can be converted from a Haskell type to a Python object. -}
Python/Objects/Dict.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-overlapping-instances #-}+{-# LANGUAGE OverlappingInstances#-} {- arch-tag: Python dict-like objects Copyright (C) 2005 John Goerzen <jgoerzen@complete.org>@@ -43,14 +43,21 @@ mkPyDict, fromPyDict) where-import Python.ForeignImports-import Python.Objects-import Python.Utils-import Foreign-import Foreign.C.Types-import Python.Exceptions-import Database.AnyDBM-import Python.Types+import Python.ForeignImports (pyObject_SetItem, pyObject_DelItem, pyObject_GetItem, pyErr_Clear, pyMapping_Keys)+import Python.Objects(+ toPyObject+ , fromPyObject+ , hasattr+ , noKwParms+ , noParms+ , runMethodHs+ , toPyObject+ )+import Python.Utils (withPyObject, checkCInt, fromCPyObject)+import Foreign (Ptr, nullPtr)+import Python.Exceptions (catchPy, exc2ioerror)+import Database.AnyDBM (AnyDBM (..))+import Python.Types (PyObject, CPyObject) {- | The basic type for a Python dict or dict-like object. -} newtype PyDict = PyDict
Python/Objects/File.hs view
@@ -1,4 +1,4 @@-{-# OPTIONS -fallow-overlapping-instances #-}+{-# LANGUAGE OverlappingInstances#-} {- arch-tag: Python file-like objects Copyright (C) 2005 John Goerzen <jgoerzen@complete.org>@@ -52,16 +52,24 @@ openModeConv ) where-import Python.Types-import Python.Utils-import Python.Objects-import Python.Interpreter-import System.IO-import System.IO.Error-import System.IO.Unsafe-import Python.Exceptions-import System.IO.HVIO-import Foreign.C.Types+import Python.Objects ( PyObject(..)+ , callMethodHs+ , fromPyObject+ , getattr+ , hasattr+ , noKwParms+ , noParms+ , runMethodHs+ , showPyObject+ , toPyObject+ )+import Python.Interpreter (callByName)+import System.IO (IOMode(..), SeekMode(..))+import System.IO.Error (eofErrorType)+import System.IO.Unsafe (unsafeInterleaveIO)+import Python.Exceptions (catchPy, exc2ioerror)+import System.IO.HVIO (HVIO(..))+import Foreign.C.Types (CInt, CLong) {- | The basic type for a Python file or file-like object.
Python/Types.hs view
@@ -43,10 +43,13 @@ ) where -import Foreign-import Foreign.C-import Foreign.C.Types-import Data.Typeable+import Foreign (ForeignPtr)+import Data.Typeable (+ TyCon+ , mkTyConApp+ , mkTyCon+ , Typeable(..)+ ) type CPyObject = ()
Python/Utils.hs view
@@ -48,14 +48,26 @@ py_incref ) where-import Python.Types-import Python.ForeignImports-import Foreign.C.Types-import Foreign.C-import Foreign-import Foreign.Ptr-import Foreign.Marshal.Array-import Foreign.Marshal.Alloc+import Python.Types (+ CPyObject(..)+ , PyObject(..)+ , PyException(excType, excValue, excTraceBack, excFormatted, PyException)+ )+import Python.ForeignImports (+ cNone+ , cpyImport_AddModule+ , cpyModule_GetDict+ , pyErr_Clear+ , pyErr_Fetch+ , pyErr_NormalizeException+ , py_decref+ , py_incref+ , py_incref+ )++import Foreign.C.Types (CInt)+import Foreign.C (withCString)+import Foreign (peek, Ptr, newForeignPtr, nullPtr, alloca, withForeignPtr) import Control.OldException (throwDyn) {- | Convert a Ptr 'CPyObject' to a 'PyObject'. -}
Setup.hs view
@@ -8,7 +8,7 @@ import qualified Distribution.Verbosity as Verbosity import Data.List -main = defaultMainWithHooks defaultUserHooks {+main = defaultMainWithHooks autoconfUserHooks { hookedPrograms = [pyConfigProgram], postConf=configure }