comparison roundup/cgi/client.py @ 5613:0a8f0fddc2ae

Support non-ASCII prefixes in instance config for finding static files (issue2551022).
author Cédric Krier <cedric.krier@b2ck.com>
date Sat, 16 Feb 2019 17:48:36 +0000
parents 5df309febe49
children 14e176b5cd90
comparison
equal deleted inserted replaced
5612:da2decb6d0c7 5613:0a8f0fddc2ae
46 from email.mime.base import MIMEBase 46 from email.mime.base import MIMEBase
47 from email.mime.text import MIMEText 47 from email.mime.text import MIMEText
48 from email.mime.multipart import MIMEMultipart 48 from email.mime.multipart import MIMEMultipart
49 import roundup.anypy.email_ 49 import roundup.anypy.email_
50 50
51 from roundup.anypy.strings import s2b, b2s, uchr 51 from roundup.anypy.strings import s2b, b2s, uchr, is_us
52 52
53 def initialiseSecurity(security): 53 def initialiseSecurity(security):
54 '''Create some Permissions and Roles on the security object 54 '''Create some Permissions and Roles on the security object
55 55
56 This function is directly invoked by security.Security.__init__() 56 This function is directly invoked by security.Security.__init__()
1509 # figure the filename - try STATIC_FILES, then TEMPLATES dir 1509 # figure the filename - try STATIC_FILES, then TEMPLATES dir
1510 for dir_option in ('STATIC_FILES', 'TEMPLATES'): 1510 for dir_option in ('STATIC_FILES', 'TEMPLATES'):
1511 prefix = self.instance.config[dir_option] 1511 prefix = self.instance.config[dir_option]
1512 if not prefix: 1512 if not prefix:
1513 continue 1513 continue
1514 if type(prefix) is str: 1514 if is_us(prefix):
1515 # prefix can be a string or list depending on 1515 # prefix can be a string or list depending on
1516 # option. Make it a list to iterate over. 1516 # option. Make it a list to iterate over.
1517 prefix = [ prefix ] 1517 prefix = [ prefix ]
1518 1518
1519 for p in prefix: 1519 for p in prefix:

Roundup Issue Tracker: http://roundup-tracker.org/