From a4e670de43977d47ed08f02fb400af264876b790 Mon Sep 17 00:00:00 2001 From: Mathieu PATUREL Date: Sun, 8 Jan 2017 15:40:25 +1100 Subject: [PATCH] clean code/files --- default.css | 2 +- escape_amp.py | 7 ++++--- image_manager.py | 4 ++-- 404-image.png => imgs/404-image.png | Bin imgs/README.md | 1 + loading.png => imgs/loading.png | Bin 6 files changed, 8 insertions(+), 6 deletions(-) rename 404-image.png => imgs/404-image.png (100%) create mode 100644 imgs/README.md rename loading.png => imgs/loading.png (100%) diff --git a/default.css b/default.css index 07a22fb..7ca94f1 100644 --- a/default.css +++ b/default.css @@ -1,5 +1,5 @@ html { - --light-bg: color(var(--background) blend(#999 85%)) + --light-bg: color(var(--background) blend(#999 85%)); } body { padding:10px; diff --git a/escape_amp.py b/escape_amp.py index 4e783b5..5b3c078 100644 --- a/escape_amp.py +++ b/escape_amp.py @@ -2,9 +2,7 @@ import re -__all__ = [ - 'escape_amp' -] +__all__ = ['escape_amp'] RE_REPLACE_AMPERSAND = re.compile(r'&(\w*)(;)?') @@ -27,11 +25,14 @@ def run_tests(): fails = 0 for i, (subject, result) in enumerate(tests): if RE_REPLACE_AMPERSAND.sub(replace, subject) != result: + # CSW: ignore print('TEST FAIL ({i}): {subject!r} escaped did not match {result!r}'.format(**locals())) fails += 1 if fails == 0: + # CSW: ignore print("SUCCESS: every tests ({}) passed successfully!".format(len(tests))) else: + # CSW: ignore print("{} test{} failed".format(fails, 's' if fails > 1 else '')) if __name__ == '__main__': diff --git a/image_manager.py b/image_manager.py index 3cc1146..c69f274 100644 --- a/image_manager.py +++ b/image_manager.py @@ -1,11 +1,11 @@ # -*- encoding: utf-8 -*- import os.path +import tempfile +import sublime from threading import Thread import urllib.request, urllib.error -import sublime from .functions import * -import tempfile CACHE_FILE = os.path.join(tempfile.gettempdir(), 'MarkdownLivePreviewCache.txt') diff --git a/404-image.png b/imgs/404-image.png similarity index 100% rename from 404-image.png rename to imgs/404-image.png diff --git a/imgs/README.md b/imgs/README.md new file mode 100644 index 0000000..ea4491e --- /dev/null +++ b/imgs/README.md @@ -0,0 +1 @@ +There is images here, allthough they aren't of any use for the plugin. They're just the image that I used to generate the base64 (404.txt and loading.txt) diff --git a/loading.png b/imgs/loading.png similarity index 100% rename from loading.png rename to imgs/loading.png