GitHub user rectang opened a pull request:

    https://github.com/apache/lucy-clownfish/pull/57

    CLOWNFISH-66 Py glue part 1

    Glue code for the Python host.
    
    * Refcounting
    * Error handling
    * Host conversion for basic types
    * Argument conversion
    * Callbacks for overridden methods

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rectang/lucy-clownfish CLOWNFISH-66-py-glue1

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucy-clownfish/pull/57.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #57
    
----
commit 5b9dc340a30678b048497308b266b1b1c4b995da
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-21T00:25:02Z

    Use Python refcounting.
    
    In our Python bindings, Clownfish objects are Python objects, so use
    Python's refcounting.

commit 7e81bd9cc46ab5f0a019c4304beb6c205c95e06c
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-22T23:40:08Z

    Implement Clownfish exceptions using `longjmp`.
    
    Though Python uses exceptions, executing exceptions from the Python C
    API requires setting thread-local error information and indicating an
    error condition to the Python interpreter by returning NULL from the
    glue function.  So Clownfish has to have its own independent exception
    handling.

commit 0734bd8fdcbced30cddc84d201d5b4da8b1fe2ba
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-23T00:51:01Z

    Re-raise Python exceptions from Clownfish.
    
    Add a function which takes the Python `sys.exc_info`, wraps it in a
    Clownfish Err, and THROWs it.

commit cddc881276ef48b3f72c82075bcb6148bdad2543
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-23T01:14:30Z

    Add ParseTuple-compatible converters for numerics.
    
    Add some conversion functions which conform to the API specified by
    Python's ParseTuple C functionality.

commit d7dd9903931b883cfd2d589509024a74fd0bb9d6
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-26T00:39:02Z

    Add wrappers for `To_Host` in Python bindings.
    
    Add NULL-safe wrappers, one of which is refcount neutral.

commit c29a47ae2655586ad8744c32957eba199f8a7727
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-26T00:41:37Z

    `To_Host` for Python returns incref'd self.
    
    The default implementation for `To_Host` for Python just returns the
    result of calling INCREF on the invocant.

commit 9bf294d6877fb5b14068d2342765baa6b876ffa5
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-26T01:02:25Z

    To_Host for composite types to Python.
    
    Implement To_Host conversion for Hash -> Python dict and Vector ->
    Python list.

commit a0b1b9aa0b16b89c7cca4cb9191fe3d6b0a177bc
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-26T01:26:40Z

    Implement scalar types To_Host for Python.
    
    - String  -> string
    - Blob    -> bytes
    - Boolean -> bool
    - Integer -> int
    - Float   -> float

commit 1a8fb6c7d49a1dd6a680704009bf079cb2c534e9
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-26T23:41:11Z

    Prepare to trap errors in Python glue code.
    
    Add `CFBind_run_trapped`, which is designed to wrap Clownfish
    C routines and trap errors.  This will be used inside glue code for
    Python, either returning a Python object or setting `sys.exc_info` and
    returning NULL per the Python C API.

commit 96a45d26f3f1199626e4055b291b2845fe338cee
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-27T01:24:22Z

    Add CF pound-includes in autogen Py module file.

commit 5bd7785d4ff6228c6441c8ffeb7fc15ef616a4a7
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-27T01:42:39Z

    Add dummy py_obj_is_a implementation.

commit 0d73c1fc9d1009eae1305e1842ca243f01632e61
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-27T23:35:08Z

    Conversion routines from Python to Clownfish.

commit e4c8aad49ccd52df63579177107db0190415cecb
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-28T00:43:55Z

    Add ParseTuple converters for composite types.
    
    Provide ParseTuple-compatible C functions which convert Python list to
    Clownfish Vector and Python dict to Clownfish Hash.

commit acbfe3fafc567a3cb0279a4f595f5ca172ad43c4
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-28T00:05:37Z

    Stub out callback-generating code for Python.

commit 7d1d15ba5ee94bf959206ba03b74ef0bc0a67809
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-28T01:06:12Z

    Add dummy routine for fetching PyTypeObject.

commit 08008763b4ed16c8ad7f3142c63c42cb3514469a
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-28T01:13:51Z

    ParseTuple routines for Obj, String.

commit 92e03bdaacd47b80d05064733d63dd336bb97d5e
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-28T02:23:36Z

    Add helper routines for Python callbacks.
    
    The generated C code for calling back into Python from Clownfish when a
    method is overridden will require these helper functions for running the
    Python callable, converting return values, etc.

commit ab3639d092d0d0751d53418099a82523d34615ce
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-28T03:14:25Z

    Generate OVERRIDEs for non-overrideable meths.
    
    Generate error-throwing OVERRIDE routines for methods which cannot be
    overridden.

commit 1ff7405eab4a5252bf11f443cd6ebee019c050c4
Author: Marvin Humphrey <[email protected]>
Date:   2016-01-28T03:24:32Z

    Gen OVERRIDE callbacks for Python.
    
    Generate the C functions which call back into Python from
    Clownfish-flavored C when a method is overridden.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to