From 08592083e706f76a5e141c907407a70ee57d9076 Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Sat, 7 Nov 2020 20:40:17 -0600 Subject: [PATCH] Make new extension --- source/conf.py.example | 15 +++++++-------- source/zaz.py | 14 +++++++------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/source/conf.py.example b/source/conf.py.example index f7600c0..71e87d3 100644 --- a/source/conf.py.example +++ b/source/conf.py.example @@ -25,14 +25,15 @@ import logging # ~ 3 = Calc addin TYPE_EXTENSION = 1 +# ~ Your great extension name, not used spaces +NAME = 'MyFirstExtension' + # ~ https://semver.org/ VERSION = '0.1.0' -# ~ Your great extension name, not used spaces -NAME = 'TestMacro' # ~ Should be unique, used URL inverse -ID = 'org.myextension.test' +ID = 'org.myfirstextension' # ~ If you extension will be multilanguage set: True # ~ This feature used gettext, set pythonpath and easymacro in True @@ -42,6 +43,7 @@ USE_LOCALES = True DOMAIN = 'base' PATH_LOCALES = 'locales' PATH_PYGETTEXT = '/usr/lib/python3.8/Tools/i18n/pygettext.py' +# ~ You can use PoEdit for update locales too PATH_MSGMERGE = 'msgmerge' @@ -56,9 +58,6 @@ ICON = 'images/logo.png' # ~ Name inside extensions ICON_EXT = f'{NAME.lower()}.png' -# ~ For example -# ~ DEPENDENCIES_MINIMAL = '6.0' -DEPENDENCIES_MINIMAL = '' # ~ Change for you favorite license LICENSE_EN = f"""This file is part of {NAME}. @@ -80,12 +79,12 @@ LICENSE_ES = LICENSE_EN INFO = { 'en': { - 'display_name': 'Test Macro', + 'display_name': 'My first extension', 'description': 'My great extension', 'license': LICENSE_EN, }, 'es': { - 'display_name': 'Macro de Prueba', + 'display_name': 'Mi primer extensión', 'description': 'Mi gran extensión', 'license': LICENSE_ES, }, diff --git a/source/zaz.py b/source/zaz.py index 74b49f7..be45675 100755 --- a/source/zaz.py +++ b/source/zaz.py @@ -44,7 +44,8 @@ from conf import ( log) -EASYMACRO = 'easymacro2.py' +EASYMACRO_TMP = 'easymacro2.py' +EASYMACRO = 'easymacro.py' class LiboXML(object): @@ -552,7 +553,7 @@ def _update_files(): copyfile(source, target) if FILES['easymacro']: - source = 'easymacro.py' + source = EASYMACRO target = _join(path_source, 'pythonpath', source) copyfile(source, target) @@ -620,7 +621,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) @@ -696,8 +696,6 @@ def _embed(args): def _locales(args): - EASYMACRO = 'easymacro.py' - if args.files: files = args.files.split(',') else: @@ -747,10 +745,12 @@ def _new(args): path_logo = 'images/pymacros.png' copyfile(path_logo, _join(path, 'images/logo.png')) copyfile('zaz.py', _join(path, 'zaz.py')) - copyfile(EASYMACRO, _join(path, 'easymacro.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' + msg = 'Folders and files copy successfully for new extension.' + log.info(msg) + msg = f'Change to folder: {path}' log.info(msg) return