Fix #1
This commit is contained in:
parent
d3caa8e171
commit
fed3f6a020
16
easymacro.py
16
easymacro.py
|
@ -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.
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue