/usr/share/pyshared/d_rats/callsigns.py is in d-rats 0.3.3-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | import re
def find_us_callsigns(string):
extra2x1 = "[aAkKnNwW][A-z][0-9][A-z]"
others = "[aAkKnNwW][A-z]?[0-9][A-z]{2,3}"
regex = "\\b(%s|%s)\\b" % (extra2x1, others)
return re.findall(regex, string)
def find_au_callsigns(string):
regex = '\\b[Vv][Kk][0-9][Ff]?[A-z]{2,3}'
return re.findall(regex, string)
def find_ca_callsigns(string):
regex = '[Vv][EeAa][0-9][A-z]{2,3}'
return re.findall(regex, string)
callsign_functions = {
"US" : find_us_callsigns,
"Australia" : find_au_callsigns,
"Canada" : find_ca_callsigns,
}
def find_callsigns(config, string):
list = []
cs = eval(config.get("prefs", "callsigns"))
enabled = [y for x,y in cs if x]
for t in callsign_functions.keys():
if callsign_functions.has_key(t) and t in enabled:
list += callsign_functions[t](string)
return list
|