Use $QUAYPATH and $QUAYDIR in conf and init files
This commit is contained in:
parent
334a08d90b
commit
cdb3722c17
59 changed files with 341 additions and 225 deletions
|
@ -2,7 +2,8 @@ import urllib2
|
|||
import re
|
||||
import os
|
||||
|
||||
LOCAL_DIRECTORY = '/static/ldn/'
|
||||
from _init import STATIC_FONTS_DIR, STATIC_LDN_DIR
|
||||
LOCAL_PATH = '/static/ldn/'
|
||||
|
||||
EXTERNAL_JS = [
|
||||
'code.jquery.com/jquery.js',
|
||||
|
@ -56,14 +57,14 @@ EXTERNAL_CSS_FONTS = [
|
|||
|
||||
def get_external_javascript(local=False):
|
||||
if local:
|
||||
return [LOCAL_DIRECTORY + format_local_name(src) for src in EXTERNAL_JS]
|
||||
return [LOCAL_PATH + format_local_name(src) for src in EXTERNAL_JS]
|
||||
|
||||
return ['//' + src for src in EXTERNAL_JS]
|
||||
|
||||
|
||||
def get_external_css(local=False):
|
||||
if local:
|
||||
return [LOCAL_DIRECTORY + format_local_name(src) for src in EXTERNAL_CSS]
|
||||
return [LOCAL_PATH + format_local_name(src) for src in EXTERNAL_CSS]
|
||||
|
||||
return ['//' + src for src in EXTERNAL_CSS]
|
||||
|
||||
|
@ -88,7 +89,7 @@ if __name__ == '__main__':
|
|||
|
||||
filename = format_local_name(url)
|
||||
print 'Writing %s' % filename
|
||||
with open(LOCAL_DIRECTORY + filename, 'w') as f:
|
||||
with open(STATIC_LDN_DIR + filename, 'w') as f:
|
||||
f.write(contents)
|
||||
|
||||
for url in EXTERNAL_CSS_FONTS:
|
||||
|
@ -96,7 +97,7 @@ if __name__ == '__main__':
|
|||
response = urllib2.urlopen('https://' + url)
|
||||
|
||||
filename = os.path.basename(url).split('?')[0]
|
||||
with open('static/ldn/' + filename, "wb") as local_file:
|
||||
with open(STATIC_LDN_DIR + filename, "wb") as local_file:
|
||||
local_file.write(response.read())
|
||||
|
||||
for url in EXTERNAL_FONTS:
|
||||
|
@ -104,5 +105,5 @@ if __name__ == '__main__':
|
|||
response = urllib2.urlopen('https://' + url)
|
||||
|
||||
filename = os.path.basename(url).split('?')[0]
|
||||
with open('static/fonts/' + filename, "wb") as local_file:
|
||||
with open(STATIC_FONTS_DIR + filename, "wb") as local_file:
|
||||
local_file.write(response.read())
|
||||
|
|
Reference in a new issue