Update easymacro
This commit is contained in:
parent
6dcff55664
commit
c5efb5e1e8
Binary file not shown.
|
@ -24,6 +24,21 @@ TEMPLATE = """\documentclass{{article}}
|
||||||
|
|
||||||
\end{{document}}
|
\end{{document}}
|
||||||
"""
|
"""
|
||||||
|
# ~ TEMPLATE = """\documentclass{{standalone}}
|
||||||
|
# ~ \\usepackage[a5paper, landscape]{{geometry}}
|
||||||
|
# ~ \\usepackage{{xcolor}}
|
||||||
|
# ~ \\usepackage{{amssymb}}
|
||||||
|
# ~ \\usepackage{{amsmath}}
|
||||||
|
# ~ \\usepackage{{tikz}}
|
||||||
|
# ~ \pagestyle{{empty}}
|
||||||
|
# ~ \\begin{{document}}
|
||||||
|
# ~ \\begin{{tikzpicture}}
|
||||||
|
|
||||||
|
# ~ \[ {} \]
|
||||||
|
|
||||||
|
# ~ \end{{tikzpicture}}
|
||||||
|
# ~ \end{{document}}
|
||||||
|
# ~ """
|
||||||
|
|
||||||
|
|
||||||
class Controllers(object):
|
class Controllers(object):
|
||||||
|
@ -199,6 +214,7 @@ class ZAZLaTex2SVG(unohelper.Base, XJobExecutor):
|
||||||
app.run(cmd)
|
app.run(cmd)
|
||||||
cmd = f'pdfcrop "{path_pdf}" "{path_pdf}"'
|
cmd = f'pdfcrop "{path_pdf}" "{path_pdf}"'
|
||||||
app.run(cmd)
|
app.run(cmd)
|
||||||
|
app.paths.copy(path_pdf, '/home/mau/')
|
||||||
cmd = f'pdf2svg "{path_pdf}" "{path_svg}"'
|
cmd = f'pdf2svg "{path_pdf}" "{path_svg}"'
|
||||||
app.run(cmd)
|
app.run(cmd)
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ from decimal import Decimal
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from pprint import pprint
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import uno
|
import uno
|
||||||
|
@ -86,6 +87,7 @@ logging.addLevelName(logging.INFO, '\x1b[32mINFO\033[1;0m')
|
||||||
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT, datefmt=LOG_DATE)
|
logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT, datefmt=LOG_DATE)
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
LOG_NAME = 'ZAZ'
|
||||||
|
|
||||||
LEFT = 0
|
LEFT = 0
|
||||||
CENTER = 1
|
CENTER = 1
|
||||||
|
@ -250,6 +252,13 @@ def info(*args):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def save_log(path, data):
|
||||||
|
with open(path, 'a') as f:
|
||||||
|
f.write(f'{str(now())[:19]} -{LOG_NAME}- ')
|
||||||
|
pprint(data, stream=f)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def catch_exception(f):
|
def catch_exception(f):
|
||||||
@wraps(f)
|
@wraps(f)
|
||||||
def func(*args, **kwargs):
|
def func(*args, **kwargs):
|
||||||
|
@ -282,6 +291,14 @@ def mri(obj):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def run_in_thread(fn):
|
||||||
|
def run(*k, **kw):
|
||||||
|
t = threading.Thread(target=fn, args=k, kwargs=kw)
|
||||||
|
t.start()
|
||||||
|
return t
|
||||||
|
return run
|
||||||
|
|
||||||
|
|
||||||
def now(only_time=False):
|
def now(only_time=False):
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
if only_time:
|
if only_time:
|
||||||
|
@ -372,6 +389,7 @@ def _array_to_dict(values):
|
||||||
d = {v[0]: v[1] for v in values}
|
d = {v[0]: v[1] for v in values}
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
||||||
def _property_to_dict(values):
|
def _property_to_dict(values):
|
||||||
d = {v.Name: v.Value for v in values}
|
d = {v.Name: v.Value for v in values}
|
||||||
return d
|
return d
|
||||||
|
@ -1257,6 +1275,13 @@ class LOCalcRange(object):
|
||||||
def formula(self, values):
|
def formula(self, values):
|
||||||
self.obj.setFormulaArray(values)
|
self.obj.setFormulaArray(values)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def array_formula(self):
|
||||||
|
return self.obj.ArrayFormula
|
||||||
|
@array_formula.setter
|
||||||
|
def array_formula(self, value):
|
||||||
|
self.obj.ArrayFormula = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def address(self):
|
def address(self):
|
||||||
return self.obj.CellAddress
|
return self.obj.CellAddress
|
||||||
|
|
Loading…
Reference in New Issue