added some more python files
This commit is contained in:
parent
63367e3aac
commit
9eea66c6f8
5 changed files with 57 additions and 0 deletions
15
amounts.py
Normal file
15
amounts.py
Normal file
|
|
@ -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
|
||||||
13
pyamounts.cc
Normal file
13
pyamounts.cc
Normal file
|
|
@ -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();
|
||||||
|
}
|
||||||
14
setup_amounts.py
Executable file
14
setup_amounts.py
Executable file
|
|
@ -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"])])
|
||||||
15
setup_ledger.py
Executable file
15
setup_ledger.py
Executable file
|
|
@ -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"])])
|
||||||
Loading…
Add table
Reference in a new issue