Replace easymacro2 for easymacro
This commit is contained in:
parent
73c0a8e258
commit
8c659c8af9
|
@ -1,4 +1,6 @@
|
|||
# ---> Python
|
||||
*.po~
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
|
|
@ -20,7 +20,7 @@ Requirements:
|
|||
#### but, don't make the mistake of many of *thinking only in gratis software* that so much damage has done to **Free Software**.
|
||||
|
||||
|
||||
This extension have a cost of maintenance of 5 euros every year.
|
||||
This extension have a cost of maintenance of 1 euro every year.
|
||||
|
||||
BCH: `qztd3l00xle5tffdqvh2snvadkuau2ml0uqm4n875d`
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1 +0,0 @@
|
|||
/home/mau/Projects/libre_office/zaz/source/easymacro2.py
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
import uno
|
||||
import unohelper
|
||||
from com.sun.star.task import XJobExecutor
|
||||
import easymacro2 as app
|
||||
import easymacro as app
|
||||
|
||||
|
||||
ID_EXTENSION = 'net.elmau.zaz.latex2svg'
|
||||
|
|
File diff suppressed because it is too large
Load Diff
56
zaz.py
56
zaz.py
|
@ -4,6 +4,8 @@
|
|||
|
||||
# ~ This file is part of ZAZ.
|
||||
|
||||
# ~ https://git.elmau.net/elmau/zaz
|
||||
|
||||
# ~ ZAZ is free software: you can redistribute it and/or modify
|
||||
# ~ it under the terms of the GNU General Public License as published by
|
||||
# ~ the Free Software Foundation, either version 3 of the License, or
|
||||
|
@ -44,6 +46,10 @@ from conf import (
|
|||
log)
|
||||
|
||||
|
||||
EASYMACRO_TMP = 'easymacro2.py'
|
||||
EASYMACRO = 'easymacro.py'
|
||||
|
||||
|
||||
class LiboXML(object):
|
||||
CONTEXT = {
|
||||
'calc': 'com.sun.star.sheet.SpreadsheetDocument',
|
||||
|
@ -549,7 +555,7 @@ def _update_files():
|
|||
copyfile(source, target)
|
||||
|
||||
if FILES['easymacro']:
|
||||
source = 'easymacro2.py'
|
||||
source = EASYMACRO
|
||||
target = _join(path_source, 'pythonpath', source)
|
||||
copyfile(source, target)
|
||||
|
||||
|
@ -595,7 +601,7 @@ def _update_files():
|
|||
return
|
||||
|
||||
|
||||
def _new():
|
||||
def _create():
|
||||
if not _validate_new():
|
||||
return
|
||||
|
||||
|
@ -617,7 +623,6 @@ def _get_info_path(path):
|
|||
|
||||
def _zip_embed(source, files):
|
||||
PATH = 'Scripts/python/'
|
||||
EASYMACRO = 'easymacro2.py'
|
||||
FILE_PYC = 'easymacro.pyc'
|
||||
|
||||
p, f, name, e = _get_info_path(source)
|
||||
|
@ -693,8 +698,6 @@ def _embed(args):
|
|||
|
||||
|
||||
def _locales(args):
|
||||
EASYMACRO = 'easymacro2.py'
|
||||
|
||||
if args.files:
|
||||
files = args.files.split(',')
|
||||
else:
|
||||
|
@ -726,8 +729,39 @@ def _update():
|
|||
return
|
||||
|
||||
|
||||
def _new(args):
|
||||
if not args.target:
|
||||
msg = 'Add argument target: -t PATH_TARGET'
|
||||
log.error(msg)
|
||||
return
|
||||
|
||||
if not args.name:
|
||||
msg = 'Add argument name: -n name-new-extension'
|
||||
log.error(msg)
|
||||
return
|
||||
|
||||
path = _join(args.target, args.name)
|
||||
_mkdir(path)
|
||||
_mkdir(_join(path, 'files'))
|
||||
_mkdir(_join(path, 'images'))
|
||||
path_logo = 'images/pymacros.png'
|
||||
copyfile(path_logo, _join(path, 'images/logo.png'))
|
||||
copyfile('zaz.py', _join(path, 'zaz.py'))
|
||||
copyfile(EASYMACRO_TMP, _join(path, 'easymacro.py'))
|
||||
copyfile('conf.py.example', _join(path, 'conf.py'))
|
||||
|
||||
msg = 'Folders and files copy successfully for new extension.'
|
||||
log.info(msg)
|
||||
msg = f'Change to folder: {path}'
|
||||
log.info(msg)
|
||||
return
|
||||
|
||||
|
||||
def main(args):
|
||||
if args.new:
|
||||
_new(args)
|
||||
return
|
||||
|
||||
if args.update:
|
||||
_update()
|
||||
return
|
||||
|
@ -740,8 +774,8 @@ def main(args):
|
|||
_embed(args)
|
||||
return
|
||||
|
||||
if args.new:
|
||||
_new()
|
||||
if args.create:
|
||||
_create()
|
||||
return
|
||||
|
||||
if not _validate_update():
|
||||
|
@ -762,9 +796,13 @@ def main(args):
|
|||
def _process_command_line_arguments():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Make LibreOffice extensions')
|
||||
parser.add_argument('-i', '--install', dest='install', action='store_true',
|
||||
parser.add_argument('-new', '--new', dest='new', action='store_true',
|
||||
default=False, required=False)
|
||||
parser.add_argument('-n', '--new', dest='new', action='store_true',
|
||||
parser.add_argument('-t', '--target', dest='target', default='')
|
||||
parser.add_argument('-n', '--name', dest='name', default='', required=False)
|
||||
parser.add_argument('-c', '--create', dest='create', action='store_true',
|
||||
default=False, required=False)
|
||||
parser.add_argument('-i', '--install', dest='install', action='store_true',
|
||||
default=False, required=False)
|
||||
parser.add_argument('-e', '--embed', dest='embed', action='store_true',
|
||||
default=False, required=False)
|
||||
|
|
Loading…
Reference in New Issue