moved wttr.py to lib/view/
This commit is contained in:
parent
4ea5c74b03
commit
826cedf1f0
2 changed files with 6 additions and 5 deletions
|
|
@ -122,3 +122,7 @@ def get_help_file(lang):
|
||||||
if os.path.exists(help_file):
|
if os.path.exists(help_file):
|
||||||
return help_file
|
return help_file
|
||||||
return HELP_FILE
|
return HELP_FILE
|
||||||
|
|
||||||
|
def remove_ansi(sometext):
|
||||||
|
ansi_escape = re.compile(r'(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]')
|
||||||
|
return ansi_escape.sub('', sometext)
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,16 @@ import os
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
sys.path.insert(0, "..")
|
||||||
from translations import get_message, FULL_TRANSLATION, PARTIAL_TRANSLATION, SUPPORTED_LANGS
|
from translations import get_message, FULL_TRANSLATION, PARTIAL_TRANSLATION, SUPPORTED_LANGS
|
||||||
from globals import WEGO, CACHEDIR, \
|
from globals import WEGO, CACHEDIR, \
|
||||||
NOT_FOUND_LOCATION, DEFAULT_LOCATION, TEST_FILE, \
|
NOT_FOUND_LOCATION, DEFAULT_LOCATION, TEST_FILE, \
|
||||||
log, error
|
log, error, remove_ansi
|
||||||
|
|
||||||
def _is_invalid_location(location):
|
def _is_invalid_location(location):
|
||||||
if '.png' in location:
|
if '.png' in location:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def remove_ansi(sometext):
|
|
||||||
ansi_escape = re.compile(r'(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]')
|
|
||||||
return ansi_escape.sub('', sometext)
|
|
||||||
|
|
||||||
def get_wetter(location, ip, html=False, lang=None, query=None, location_name=None, full_address=None, url=None):
|
def get_wetter(location, ip, html=False, lang=None, query=None, location_name=None, full_address=None, url=None):
|
||||||
|
|
||||||
local_url = url
|
local_url = url
|
||||||
Loading…
Add table
Reference in a new issue