Skip to content

Commit 20675a1

Browse files
committed
Merge branch 'develop'
2 parents 6179a9d + 7da11eb commit 20675a1

File tree

5 files changed

+34
-6
lines changed

5 files changed

+34
-6
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 1.8.1 (2022-02-23)
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
- Fixed: When re-installing TexText with diffent paths to latex excutables
4+
compared to the original setup these new paths are not recognized when
5+
invoking TexText from Inkscape (:issue_num:`345`).
6+
17
Version 1.8.0 (2022-02-03)
28
~~~~~~~~~~~~~~~~~~~~~~~~~~
39
- New: It is now possible to use the ``\documentclass`` statement in the

README.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
.. image:: https://github.com/textext/textext/actions/workflows/ci.yaml/badge.svg?branch=master
2-
:target: https://github.com/textext/textext/actions/workflows/ci.yaml
3-
:alt: Status of continuous integration tests
1+
|status-ci| |status-downloads|
42

53
TexText - A TeX extension for Inkscape
64
======================================
@@ -58,3 +56,10 @@ plugin InkLaTeX written by Toru Araki.
5856
.. _usage-colorization: https://textext.github.io/textext/usage/gui.html#usage-colorization
5957
.. _usage-alignment: https://textext.github.io/textext/usage/gui.html#usage-alignment
6058
.. _usage-preview: https://textext.github.io/textext/usage/gui.html#preview-button
59+
60+
.. |status-ci| image:: https://github.com/textext/textext/actions/workflows/ci.yaml/badge.svg?branch=master
61+
:target: https://github.com/textext/textext/actions/workflows/ci.yaml
62+
:alt: Status of continuous integration tests
63+
.. |status-downloads| image:: https://img.shields.io/github/downloads/textext/textext/total
64+
:alt: GitHub all releases
65+

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
LoggingColors, \
2828
SUCCESS
2929

30-
from textext.utility import Settings
30+
from textext.utility import Settings, Cache
3131

3232

3333
# Hotfix for Inkscape 1.0.1 on Windows: HarfBuzz-0.0.typelib is missing
@@ -350,6 +350,9 @@ def remove_previous_installation(extension_dir):
350350
else:
351351
settings = Settings(directory=defaults.textext_config_path)
352352

353+
CachedSettings = Cache(directory=settings.directory)
354+
CachedSettings.delete_file()
355+
353356
checker = TexTextRequirementsChecker(logger, settings)
354357

355358
for executable_name in [
@@ -365,6 +368,8 @@ def remove_previous_installation(extension_dir):
365368
exit(EXIT_BAD_COMMAND_LINE_ARGUMENT_VALUE)
366369

367370
settings["%s-executable" % executable_name] = executable_path
371+
else:
372+
settings["%s-executable" % executable_name] = None
368373

369374
if not args.skip_requirements_check:
370375

textext/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8.0
1+
1.8.1

textext/utility.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def __init__(self, basename="config.json", directory=None):
168168
if not os.path.exists(directory):
169169
os.makedirs(directory, exist_ok=True)
170170
self.values = {}
171+
self.directory = directory
171172
self.config_path = os.path.join(directory, basename)
172173
try:
173174
self.load()
@@ -189,11 +190,22 @@ def get(self, key, default=None):
189190
return default
190191
return result
191192

193+
def delete_file(self):
194+
if os.path.exists(self.config_path):
195+
try:
196+
os.remove(self.config_path)
197+
except OSError as err:
198+
TexTextFatalError("Config `%s` could not be deleted. Error message: %s" % (
199+
self.config_path, str(err)))
200+
192201
def __getitem__(self, key):
193202
return self.values.get(key)
194203

195204
def __setitem__(self, key, value):
196-
self.values[key] = value
205+
if value is not None:
206+
self.values[key] = value
207+
else:
208+
self.values.pop(key, None)
197209

198210

199211
class Cache(Settings):

0 commit comments

Comments
 (0)