From ef727a64723939751e3e480bf729cd06813df1e9 Mon Sep 17 00:00:00 2001
From: Hal Finkel <hfinkel@anl.gov>
Date: Fri, 26 Aug 2016 20:42:36 -0500
Subject: [PATCH] Some python cleanups and an example

---
 GNUmakefile       | 5 +----
 python/example.py | 9 +++++++++
 python/gio.py     | 4 ++--
 3 files changed, 12 insertions(+), 6 deletions(-)
 create mode 100644 python/example.py

diff --git a/GNUmakefile b/GNUmakefile
index cbc4199..f53c2da 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -145,9 +145,6 @@ endif
 $(FEDIR)/libpygio.so: $(FEDIR)/GenericIO.o $(FEDIR)/python/lib/gio.o $(FE_BLOSC_O)
 	$(CXX) $(FE_CFLAGS) $(FE_SHARED) -o $@ $^
 
-$(FEDIR)/gio.py: python/gio.py
-	cp -f $< $@
-
 $(FEDIR)/GenericIOSQLite.so: $(FEDIR)/GenericIOSQLite.o $(FEDIR)/GenericIO.o $(FE_BLOSC_O)
 	$(CXX) $(FE_CFLAGS) $(FE_SHARED) -o $@ $^
 
@@ -190,7 +187,7 @@ $(MPIDIR)/GenericIOBenchmarkWrite: $(MPIDIR)/GenericIOBenchmarkWrite.o $(MPIDIR)
 $(MPIDIR)/GenericIORewrite: $(MPIDIR)/GenericIORewrite.o $(MPIDIR)/GenericIO.o $(MPI_BLOSC_O)
 	$(MPICXX) $(MPI_CFLAGS) -o $@ $^ 
 
-frontend-progs: $(FEDIR)/GenericIOPrint $(FEDIR)/GenericIOVerify $(FEDIR)/libpygio.so $(FEDIR)/gio.py
+frontend-progs: $(FEDIR)/GenericIOPrint $(FEDIR)/GenericIOVerify $(FEDIR)/libpygio.so
 fe-progs: frontend-progs
 
 mpi-progs: $(MPIDIR)/GenericIOPrint $(MPIDIR)/GenericIOVerify $(MPIDIR)/GenericIOBenchmarkRead $(MPIDIR)/GenericIOBenchmarkWrite $(MPIDIR)/GenericIORewrite
diff --git a/python/example.py b/python/example.py
new file mode 100644
index 0000000..9b1e04d
--- /dev/null
+++ b/python/example.py
@@ -0,0 +1,9 @@
+import sys
+import gio
+
+name = sys.argv[1]
+gio.gio_inspect(name)
+
+x = gio.gio_read(name, "x")
+print x
+
diff --git a/python/gio.py b/python/gio.py
index 3125d29..a37a8fc 100644
--- a/python/gio.py
+++ b/python/gio.py
@@ -27,7 +27,7 @@
 # *****************************************************************************
 # 
 #                                  DISCLAIMER
-# THE SOFTWARE IS SUPPLIED “AS IS” WITHOUT WARRANTY OF ANY KIND.  NEITHER THE
+# THE SOFTWARE IS SUPPLIED "AS IS" WITHOUT WARRANTY OF ANY KIND.  NEITHER THE
 # UNTED STATES GOVERNMENT, NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR
 # UCHICAGO ARGONNE, LLC, NOR ANY OF THEIR EMPLOYEES, MAKES ANY WARRANTY,
 # EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE
@@ -43,7 +43,7 @@ import os
 
 #Define where the library is and load it
 _path = os.path.dirname('__file__')
-libpygio = ct.CDLL(os.path.abspath('libpygio.so'))
+libpygio = ct.CDLL(os.path.abspath('../frontend/libpygio.so'))
 #we need to define the return type ("restype") and
 #the argument types
 libpygio.get_elem_num.restype=ct.c_int64
-- 
GitLab