diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-29 23:33:22 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-29 23:33:22 -0400 |
commit | 9eea66c6f8182ff396141a7be11837b0a0473a36 (patch) | |
tree | 852ab529ef2a3750f02490d06b28acc7aa8c6a84 | |
parent | 63367e3aac062a7b55a3ba5c36a6c7fffbb6e2cc (diff) | |
download | fork-ledger-9eea66c6f8182ff396141a7be11837b0a0473a36.tar.gz fork-ledger-9eea66c6f8182ff396141a7be11837b0a0473a36.tar.bz2 fork-ledger-9eea66c6f8182ff396141a7be11837b0a0473a36.zip |
added some more python files
-rw-r--r-- | amounts.py | 15 | ||||
-rw-r--r-- | pyamounts.cc | 13 | ||||
-rw-r--r-- | pyledger.cc (renamed from python.cc) | 0 | ||||
-rwxr-xr-x | setup_amounts.py | 14 | ||||
-rwxr-xr-x | setup_ledger.py | 15 |
5 files changed, 57 insertions, 0 deletions
diff --git a/amounts.py b/amounts.py new file mode 100644 index 00000000..f3a58986 --- /dev/null +++ b/amounts.py @@ -0,0 +1,15 @@ +from amounts import * + +x = Amount ("$123.45") +print x +x = x * 2 +print x + +y = Amount ("$1000.45") +print x + y + +z = Value ("$1000.45") +print y + z + +z += x +print z diff --git a/pyamounts.cc b/pyamounts.cc new file mode 100644 index 00000000..a8b982cc --- /dev/null +++ b/pyamounts.cc @@ -0,0 +1,13 @@ +#include <boost/python.hpp> + +using namespace boost::python; + +void export_amount(); +void export_balance(); +void export_value(); + +BOOST_PYTHON_MODULE(amounts) { + export_amount(); + export_balance(); + export_value(); +} diff --git a/setup_amounts.py b/setup_amounts.py new file mode 100755 index 00000000..663faa2e --- /dev/null +++ b/setup_amounts.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +from distutils.core import setup, Extension + +setup(name = "Amounts", + version = "2.0b", + description = "Amounts Library", + author = "John Wiegley", + author_email = "johnw@newartisans.com", + url = "http://www.newartisans.com/johnw/", + ext_modules = [ + Extension("amounts", ["pyamounts.cc"], + define_macros = [('PYTHON_MODULE', None)], + libraries = ["amounts_bpy", "boost_python", "gmp"])]) diff --git a/setup_ledger.py b/setup_ledger.py new file mode 100755 index 00000000..bb8a78b0 --- /dev/null +++ b/setup_ledger.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +from distutils.core import setup, Extension + +setup(name = "Ledger", + version = "2.0b", + description = "Ledger Accounting Tool", + author = "John Wiegley", + author_email = "johnw@newartisans.com", + url = "http://www.newartisans.com/johnw/", + ext_modules = [ + Extension("ledger", ["pyledger.cc"], + define_macros = [('PYTHON_MODULE', None)], + libraries = ["amounts_bpy", "ledger_bpy", "boost_python", + "pcre", "xmlparse", "xmltok"])]) |