diff --git a/files/ZAZLaTex2SVG_v0.1.0.oxt b/files/ZAZLaTex2SVG_v0.1.0.oxt index 01b626d..a1cdec1 100644 Binary files a/files/ZAZLaTex2SVG_v0.1.0.oxt and b/files/ZAZLaTex2SVG_v0.1.0.oxt differ diff --git a/source/ZAZLaTex2SVG.py b/source/ZAZLaTex2SVG.py index c22f4e1..a0a5b3a 100644 --- a/source/ZAZLaTex2SVG.py +++ b/source/ZAZLaTex2SVG.py @@ -24,6 +24,21 @@ TEMPLATE = """\documentclass{{article}} \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): @@ -199,6 +214,7 @@ class ZAZLaTex2SVG(unohelper.Base, XJobExecutor): app.run(cmd) cmd = f'pdfcrop "{path_pdf}" "{path_pdf}"' app.run(cmd) + app.paths.copy(path_pdf, '/home/mau/') cmd = f'pdf2svg "{path_pdf}" "{path_svg}"' app.run(cmd) diff --git a/source/pythonpath/easymacro2.py b/source/pythonpath/easymacro2.py index 8777491..580bca5 100644 --- a/source/pythonpath/easymacro2.py +++ b/source/pythonpath/easymacro2.py @@ -43,6 +43,7 @@ from decimal import Decimal from enum import IntEnum from functools import wraps from pathlib import Path +from pprint import pprint from typing import Any 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) log = logging.getLogger(__name__) +LOG_NAME = 'ZAZ' LEFT = 0 CENTER = 1 @@ -250,6 +252,13 @@ def info(*args): 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): @wraps(f) def func(*args, **kwargs): @@ -282,6 +291,14 @@ def mri(obj): 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): now = datetime.datetime.now() if only_time: @@ -372,6 +389,7 @@ def _array_to_dict(values): d = {v[0]: v[1] for v in values} return d + def _property_to_dict(values): d = {v.Name: v.Value for v in values} return d @@ -1257,6 +1275,13 @@ class LOCalcRange(object): def formula(self, 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 def address(self): return self.obj.CellAddress