473,385 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Barking up the wrong tree with extension types and modules?

We have a large suite of "legacy" tools (based on stand-alone executables
and shell scripts) that we would like to integrate into a suite of Python
modules. I'm having a little trouble getting my head around how the best
way to implement the whole thing, though.

Here's (roughly) the situation:

We have TypeA which is used *everywhere* in the tools. I have completed a
wrapper for TypeA and can now create Python versions of the TypeA object.
I'd now like to write wrappers for ToolSet1 and ToolSet2 which make
extensive use of TypeA.

I'd also like the resulting C code to be maintainable. I know that I can
write bighonkingmodule.c that incorporates the wrappers for TypeA,
ToolSet1, and ToolSet2, but this could easily lead to a maintenance
nightmare. I would like to have TypeA_wrap.c, ToolSet1_wrap.c and
ToolSet2_wrap.c that would generate 3 separate modules:

TypeA.so : The compatibility layer for the TypeA object.
ToolSet1.so : Compatibility layer for tools in ToolSet1
(This ingests and generates TypeA objects).
ToolSet2.so : Compatibility layer for tools in ToolSet2
(This also ingests and generates TypeA objects).

I also know that I could put a definition for TypeA in both ToolSet1 and
ToolSet2, but then (as far as I understand), outputs from ToolSet1 wouldn't
be readily available for processing in ToolSet2 because each module would
have its own idea about what a TypeA actually is.

Basically, the type of package structure I want is something like:

OurTools/
__init__.py
TypeA.so
ToolSet1.so
ToolSet2.so
ExtensionSet1.py
...

Has anybody tackled anything like this before? Are there any examples that
I could look at?

One way I've thought about doing it is kind of how I understand the
interpreter to do it which would be something like:

1. Provide libOurToolsPython.so and OurToolsPython.h that would define
common interfaces that would need to be available to all of the ToolSet
wrappers.
2. When I build ToolSet1_wrap.c, I'd need to include OurToolsPython.h and
link against libOurToolsPythyon.so

Am I thinking about this the right way, or am I *completely* twisted around
the axle here (which is kind of how I feel)?

Thanks in advance for any comments, corrections, and directions.

--
Steve Juranich
Tucson, AZ
USA

Mar 23 '06 #1
0 711

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Torsten Mohr | last post by:
Hi, i write a set of extension modules for python in C. I also use some new types that i defined there. At the moment i write some methods that expect some of these types as parameters. I...
8
by: Torsten Mohr | last post by:
Hi, i write an extension module in C at the moment. This module does some work on some own data types that consist of some values. The functions that can change the data are written in C. ...
0
by: Mike MacSween | last post by:
A Production table (theatrical production), one to many to an Event table (e.g. dress rehearsal, performance 1 etc.), a Musicians table (Names of musos), and a Roles table (1st Violin, 2nd...
0
by: robert | last post by:
Hi all, I'm having a hard time resolving a namespace issue in my wsdl. Here's an element that explains my question, with the full wsdl below: <definitions name="MaragatoService"...
1
by: zpinhead | last post by:
I am unable to get my downloaded extension from pecl to link up with php properly. seems like the php.so I could not use pear install http. pear claimed the extension was already installed....
2
by: Brian | last post by:
Thanks for your time. I've been assigned the task of building an application that will automatically print DWG files. The list of files to print is derived from a text file that is periodically...
1
by: Petr Prikryl | last post by:
Do you think that the following could became PEP (pre PEP). Please, read it, comment it, reformulate it,... Abstract Introduction of the mechanism for language extensions via modules...
1
by: Yue.Nicholas | last post by:
Hi, I have written a small prototype Python extension for a C-library. I have the methods all sorted out and it is working fine. In the C-library, they are various constants of types like...
5
by: Adam Atlas | last post by:
Does anyone know if it would be possible to create a CPython extension -- or use the ctypes module -- to access Python's own embedding API (http://docs.python.org/api/initialization.html &c.)?...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.