This commit is contained in:
Mauricio Baeza 2019-09-16 14:25:08 -05:00
parent d3caa8e171
commit fed3f6a020
4 changed files with 34 additions and 7 deletions

View File

@ -173,10 +173,12 @@ def debug(info):
# ~ doc = app.newDoc(WRITER)
# ~ out = OutputDoc(doc)
# ~ sys.stdout = out
pprint(info)
# ~ pprint(info)
doc = LogWin(new_doc('writer').obj)
doc.write(info)
return
log.debug(info)
log.debug(str(info))
return
@ -200,6 +202,11 @@ def run_in_thread(fn):
return run
def sleep(sec):
time.sleep(sec)
return
def _(msg):
L = LANGUAGE.split('-')[0]
if L == 'en':
@ -244,7 +251,10 @@ def get_dispatch():
def get_temp_file():
return tempfile.NamedTemporaryFile()
delete = True
if IS_WIN:
delete = False
return tempfile.NamedTemporaryFile(delete=delete)
def _path_url(path):

Binary file not shown.

View File

@ -54,7 +54,6 @@ class ZAZBarCode(unohelper.Base, XJobExecutor):
self._data = ''
self._type = ''
@app.catch_exception
def trigger(self, args):
self._type = args
if args == 'ask' and not self._get_values():
@ -103,6 +102,8 @@ class ZAZBarCode(unohelper.Base, XJobExecutor):
return
cell = cell.offset()
if app.IS_WIN:
tf.close()
cell.insert_image(tf.name)
tf.close()
return
@ -124,6 +125,8 @@ class ZAZBarCode(unohelper.Base, XJobExecutor):
self._show_error(result)
return
if app.IS_WIN:
tf.close()
doc.insert_image(tf.name)
tf.close()
return
@ -136,6 +139,8 @@ class ZAZBarCode(unohelper.Base, XJobExecutor):
self._show_error(result)
return
if app.IS_WIN:
tf.close()
doc.insert_image(tf.name)
tf.close()
return

View File

@ -143,6 +143,8 @@ def catch_exception(f):
try:
return f(*args, **kwargs)
except Exception as e:
if IS_WIN:
debug(str(e))
log.error(f.__name__, exc_info=True)
return func
@ -173,10 +175,12 @@ def debug(info):
# ~ doc = app.newDoc(WRITER)
# ~ out = OutputDoc(doc)
# ~ sys.stdout = out
pprint(info)
# ~ pprint(info)
doc = LogWin(new_doc('writer').obj)
doc.write(info)
return
log.debug(info)
log.debug(str(info))
return
@ -200,6 +204,11 @@ def run_in_thread(fn):
return run
def sleep(sec):
time.sleep(sec)
return
def _(msg):
L = LANGUAGE.split('-')[0]
if L == 'en':
@ -244,7 +253,10 @@ def get_dispatch():
def get_temp_file():
return tempfile.NamedTemporaryFile()
delete = True
if IS_WIN:
delete = False
return tempfile.NamedTemporaryFile(delete=delete)
def _path_url(path):