Compare commits

..

2 commits

Author SHA1 Message Date
3dfd09cc81
fix syntax error 2022-10-18 15:37:55 +02:00
01735e4c7a
style 2022-10-18 15:37:46 +02:00
2 changed files with 9 additions and 8 deletions

View file

@ -54,4 +54,4 @@ milter_protocol = 6
milter_default_action = accept milter_default_action = accept
# rspamd # rspamd
milter_mail_macros = "i {mail_addr} {client_addr} {client_name} {auth_authen}" milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}

View file

@ -11,9 +11,10 @@ class AptSource():
# parse options, which are optional # parse options, which are optional
if search(r'\[.*\]', string): if search(r'\[.*\]', string):
self.options = { self.options = {
k:v.split(',') for k,v in ( k:v.split(',')
e.split('=') for e in search(r'\[(.*)\]', string)[1].split() for k,v in (
) e.split('=') for e in search(r'\[(.*)\]', string)[1].split()
)
} }
string_without_options = sub(r'\[.*\]', '', string) string_without_options = sub(r'\[.*\]', '', string)
else: else: