mirror of
https://github.com/HorlogeSkynet/CDNUpdates
synced 2025-06-11 16:00:11 +02:00
Minor code cleanup and styles
This commit is contained in:
@ -2,8 +2,8 @@
|
||||
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from .CDNConstants import CDN_PROVIDERS
|
||||
from .CDNContent import CDNContent
|
||||
from .CDNConstants import CDN_PROVIDERS
|
||||
from .CDNUtils import log_message
|
||||
|
||||
|
||||
|
@ -8,9 +8,10 @@ from sublime import (
|
||||
DRAW_EMPTY_AS_OVERWRITE,
|
||||
DRAW_NO_FILL,
|
||||
DRAW_NO_OUTLINE,
|
||||
DRAW_SOLID_UNDERLINE
|
||||
DRAW_SOLID_UNDERLINE,
|
||||
LAYOUT_BLOCK,
|
||||
message_dialog
|
||||
)
|
||||
from sublime import LAYOUT_BLOCK, message_dialog
|
||||
|
||||
from .CDNUtils import log_message
|
||||
|
||||
|
@ -117,11 +117,9 @@ class CDNContent:
|
||||
|
||||
# CDN from CDN.JSDLIVR.NET will be handled here.
|
||||
elif self.parsed_result.netloc == 'cdn.jsdelivr.net':
|
||||
"""
|
||||
The API from JSDLIVR is powerful.
|
||||
It implies we compute a "fuzzy" version checking.
|
||||
For instance : "jquery@3" is OK for '3.2.1'.
|
||||
"""
|
||||
# The API from JSDLIVR is powerful.
|
||||
# It implies we compute a "fuzzy" version checking.
|
||||
# For instance : "jquery@3" is OK for '3.2.1'.
|
||||
tmp = self.parsed_result.path.split('/')
|
||||
|
||||
try:
|
||||
@ -138,7 +136,7 @@ class CDNContent:
|
||||
|
||||
elif tmp[1] == 'wp':
|
||||
# This how we'll handle the latest version references, as :
|
||||
# (https://cdn.jsdelivr.net/wp/wp-slimstat/trunk/wp-slimstat.js)
|
||||
# <https://cdn.jsdelivr.net/wp/wp-slimstat/trunk/wp-slimstat.js>
|
||||
if len(tmp) < 6:
|
||||
raise IndexError
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
"""CDNUpdates main class"""
|
||||
|
||||
from sublime import error_message
|
||||
|
||||
from sublime_plugin import EventListener, TextCommand
|
||||
|
||||
from .CDNCheckForCDNProviders import CheckForCDNProviders
|
||||
@ -27,10 +26,10 @@ class CDNUpdatesCommand(TextCommand): # pylint: disable=too-few-public-methods
|
||||
"""
|
||||
# First we check if the current sheet is not still being loaded.
|
||||
if self.view.is_loading():
|
||||
error_message("This file is not fully loaded yet.")
|
||||
error_message("This view is not fully loaded yet.")
|
||||
return
|
||||
|
||||
# If it's OK, we clear the view from the elements added previously.
|
||||
# If it's OK, we clear the view from the previously added elements.
|
||||
clear_view(self.view)
|
||||
|
||||
self.view.set_status(
|
||||
|
@ -71,7 +71,7 @@ You can generate one [here](https://github.com/settings/tokens), and paste in un
|
||||
|
||||
> It'll be done automatically next time you'll save your sheet :wink:
|
||||
|
||||
### I've updated my links, but the _Phantom_ objects don't want to leave...
|
||||
### I've updated my links, how can I get rid of these _Phantom_ objects ?
|
||||
|
||||
> Same as above :smile:
|
||||
|
||||
|
Reference in New Issue
Block a user