summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'demos/python/examples.py')
-rwxr-xr-xdemos/python/examples.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/demos/python/examples.py b/demos/python/examples.py
index d5c8b6ad..864bed96 100755
--- a/demos/python/examples.py
+++ b/demos/python/examples.py
@@ -127,7 +127,6 @@ def trans_ps():
# Run string to feed chunks
def run_string():
- f = None
size = 1024;
in_filename = '%s/examples/tiger.eps' % ghostpdl_root
out_filename = 'tiger_byte_fed.png'
@@ -139,19 +138,21 @@ def run_string():
gsapi.gsapi_set_arg_encoding(instance, gsapi.GS_ARG_ENCODING_UTF8)
gsapi.gsapi_init_with_args(instance, params)
- exitcode = gsapi.gsapi_run_string_begin(instance, 0)
+ gsapi.gsapi_run_string_begin(instance, 0)
with open(in_filename,"rb") as f:
while True:
data = f.read(size)
if not data:
break
- exitcode = gsapi.gsapi_run_string_continue(instance, data, 0)
+ gsapi.gsapi_run_string_continue(instance, data, 0)
exitcode = gsapi.gsapi_run_string_end(instance, 0)
end_gpdl(instance)
+ return exitcode
+
# Examples
print('***********Text extraction***********');