| CARVIEW |
Select Language
HTTP/2 200
server: nginx
date: Sun, 28 Dec 2025 05:26:14 GMT
content-type: text/plain
last-modified: Fri, 22 Oct 2010 08:45:40 -0000
etag: W/"45625-6f2-4cc14f33"
x-frame-options: sameorigin
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
content-encoding: gzip
x-clacks-overhead: GNU Terry Pratchett
strict-transport-security: max-age=315360000; includeSubDomains; preload
Index: __init__.py
===================================================================
--- __init__.py (revision 85786)
+++ __init__.py (working copy)
@@ -174,10 +174,10 @@
def make_id(str):
#str = str.replace(".", "_") # colons are allowed
- str = str.replace(" ", "_")
- str = str.replace("-", "_")
- if str[0] in string.digits:
- str = "_"+str
+ for c in " -+~":
+ str = str.replace(c, "_")
+ if str[0] in (string.digits + "."):
+ str = "_" + str
assert re.match("^[A-Za-z_][A-Za-z0-9_.]*$", str), "FILE"+str
return str
@@ -285,19 +285,28 @@
[(feature.id, component)])
def make_short(self, file):
+ oldfile = file
+ file = file.replace('+', '_')
+ file = ''.join(c for c in file if not c in ' "/\[]:;=,')
parts = file.split(".")
- if len(parts)>1:
+ if len(parts) > 1:
+ prefix = "".join(parts[:-1]).upper()
suffix = parts[-1].upper()
+ if not prefix:
+ prefix = suffix
+ suffix = None
else:
+ prefix = file.upper()
suffix = None
- prefix = parts[0].upper()
- if len(prefix) <= 8 and (not suffix or len(suffix)<=3):
+ if len(parts) < 3 and len(prefix) <= 8 and file == oldfile and (
+ not suffix or len(suffix) <= 3):
if suffix:
file = prefix+"."+suffix
else:
file = prefix
- assert file not in self.short_names
else:
+ file = None
+ if file is None or file in self.short_names:
prefix = prefix[:6]
if suffix:
suffix = suffix[:3]