DOT_ in front of link template constants

This commit is contained in:
Henrik Hank 2018-05-26 03:42:39 +02:00
parent 6cbe83852f
commit a4642440fd
2 changed files with 9 additions and 9 deletions

View File

@ -49,9 +49,11 @@ from .utils import (
date_from_str, date_from_str,
DateRange, DateRange,
DEFAULT_OUTTMPL, DEFAULT_OUTTMPL,
DESKTOP_LINK_TEMPLATE,
determine_ext, determine_ext,
determine_protocol, determine_protocol,
DOT_DESKTOP_LINK_TEMPLATE,
DOT_URL_LINK_TEMPLATE,
DOT_WEBLOC_LINK_TEMPLATE,
DownloadError, DownloadError,
encode_compat_str, encode_compat_str,
encodeFilename, encodeFilename,
@ -88,9 +90,7 @@ from .utils import (
to_high_limit_path, to_high_limit_path,
UnavailableVideoError, UnavailableVideoError,
url_basename, url_basename,
URL_LINK_TEMPLATE,
version_tuple, version_tuple,
WEBLOC_LINK_TEMPLATE,
write_json_file, write_json_file,
write_string, write_string,
YoutubeDLCookieProcessor, YoutubeDLCookieProcessor,
@ -1891,13 +1891,13 @@ class YoutubeDL(object):
return True return True
if url_link: if url_link:
if not _write_link_file('url', URL_LINK_TEMPLATE, '\r\n', embed_filename=False): if not _write_link_file('url', DOT_URL_LINK_TEMPLATE, '\r\n', embed_filename=False):
return return
if webloc_link: if webloc_link:
if not _write_link_file('webloc', WEBLOC_LINK_TEMPLATE, '\n', embed_filename=False): if not _write_link_file('webloc', DOT_WEBLOC_LINK_TEMPLATE, '\n', embed_filename=False):
return return
if desktop_link: if desktop_link:
if not _write_link_file('desktop', DESKTOP_LINK_TEMPLATE, '\n', embed_filename=True): if not _write_link_file('desktop', DOT_DESKTOP_LINK_TEMPLATE, '\n', embed_filename=True):
return return
# Download # Download

View File

@ -3908,12 +3908,12 @@ def random_birthday(year_field, month_field, day_field):
# Templates for internet shortcut files, which are plain text files. # Templates for internet shortcut files, which are plain text files.
URL_LINK_TEMPLATE = ''' DOT_URL_LINK_TEMPLATE = '''
[InternetShortcut] [InternetShortcut]
URL=%(url)s URL=%(url)s
'''.lstrip() '''.lstrip()
WEBLOC_LINK_TEMPLATE = ''' DOT_WEBLOC_LINK_TEMPLATE = '''
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
@ -3924,7 +3924,7 @@ WEBLOC_LINK_TEMPLATE = '''
</plist> </plist>
'''.lstrip() '''.lstrip()
DESKTOP_LINK_TEMPLATE = ''' DOT_DESKTOP_LINK_TEMPLATE = '''
[Desktop Entry] [Desktop Entry]
Encoding=UTF-8 Encoding=UTF-8
Name=%(filename)s Name=%(filename)s