Skip to content

Commit fc84d51

Browse files
akxc00kiemon5ter
authored andcommitted
Run flynt -tc + black + isort
1 parent 15f131d commit fc84d51

37 files changed

+2152
-2154
lines changed

example/attributemaps/saml_uri.py

+182-182
Large diffs are not rendered by default.

example/attributemaps/shibboleth_uri.py

+175-175
Large diffs are not rendered by default.

example/idp2/idp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1078,8 +1078,8 @@ def application(environ, start_response):
10781078

10791079
_rot = args.mako_root
10801080
LOOKUP = TemplateLookup(
1081-
directories=[_rot + "templates", _rot + "htdocs"],
1082-
module_directory=_rot + "modules",
1081+
directories=[f"{_rot}templates", f"{_rot}htdocs"],
1082+
module_directory=f"{_rot}modules",
10831083
input_encoding="utf-8",
10841084
output_encoding="utf-8",
10851085
)

example/idp2/idp_uwsgi.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -975,8 +975,8 @@ def application(environ, start_response):
975975

976976
_rot = args.mako_root
977977
LOOKUP = TemplateLookup(
978-
directories=[_rot + "templates", _rot + "htdocs"],
979-
module_directory=_rot + "modules",
978+
directories=[f"{_rot}templates", f"{_rot}htdocs"],
979+
module_directory=f"{_rot}modules",
980980
input_encoding="utf-8",
981981
output_encoding="utf-8",
982982
)
@@ -990,8 +990,8 @@ def application(environ, start_response):
990990
else:
991991
_rot = args.mako_root
992992
LOOKUP = TemplateLookup(
993-
directories=[_rot + "templates", _rot + "htdocs"],
994-
module_directory=_rot + "modules",
993+
directories=[f"{_rot}templates", f"{_rot}htdocs"],
994+
module_directory=f"{_rot}modules",
995995
input_encoding="utf-8",
996996
output_encoding="utf-8",
997997
)

example/idp2_repoze/idp.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -962,8 +962,8 @@ def application(environ, start_response):
962962

963963
_rot = args.mako_root
964964
LOOKUP = TemplateLookup(
965-
directories=[_rot + "templates", _rot + "htdocs"],
966-
module_directory=_rot + "modules",
965+
directories=[f"{_rot}templates", f"{_rot}htdocs"],
966+
module_directory=f"{_rot}modules",
967967
input_encoding="utf-8",
968968
output_encoding="utf-8",
969969
)
@@ -977,8 +977,8 @@ def application(environ, start_response):
977977
else:
978978
_rot = args.mako_root
979979
LOOKUP = TemplateLookup(
980-
directories=[_rot + "templates", _rot + "htdocs"],
981-
module_directory=_rot + "modules",
980+
directories=[f"{_rot}templates", f"{_rot}htdocs"],
981+
module_directory=f"{_rot}modules",
982982
input_encoding="utf-8",
983983
output_encoding="utf-8",
984984
)

example/sp-repoze/attributemaps/saml_uri.py

+182-182
Large diffs are not rendered by default.

example/sp-repoze/attributemaps/shibboleth_uri.py

+175-175
Large diffs are not rendered by default.

example/sp-repoze/sp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def metadata(environ, start_response):
209209
if path[-1] != "/":
210210
path += "/"
211211
metadata = create_metadata_string(
212-
path + "sp_conf.py", None, args.valid, args.cert, args.keyfile, args.id, args.name, args.sign
212+
f"{path}sp_conf.py", None, args.valid, args.cert, args.keyfile, args.id, args.name, args.sign
213213
)
214214
start_response("200 OK", [("Content-Type", "text/xml")])
215215
return metadata

example/sp-wsgi/sp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ def metadata(environ, start_response):
797797
if path[-1] != "/":
798798
path += "/"
799799
metadata = create_metadata_string(
800-
path + "sp_conf.py",
800+
f"{path}sp_conf.py",
801801
None,
802802
_args.valid,
803803
_args.cert,

script/utility/run_list_of_tests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66

77
for line in fileinput.input():
8-
cmd = "./run_oper.sh " + line.rstrip()
9-
print("executing " + cmd)
8+
cmd = f"./run_oper.sh {line.rstrip()}"
9+
print(f"executing {cmd}")
1010
call(cmd, shell=True)

src/saml2/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def set_prefixes(self, elem, prefix_map):
628628
uri_map = {}
629629
for prefix, uri in prefix_map.items():
630630
uri_map[uri] = prefix
631-
elem.set("xmlns:" + prefix, uri)
631+
elem.set(f"xmlns:{prefix}", uri)
632632

633633
# fixup all elements in the tree
634634
memo = {}
@@ -644,7 +644,7 @@ def fixup(name):
644644
return
645645
uri, tag = name[1:].split("}")
646646
if uri in uri_map:
647-
new_name = uri_map[uri] + ":" + tag
647+
new_name = f"{uri_map[uri]}:{tag}"
648648
memo[name] = new_name
649649
return new_name
650650

src/saml2/attributemaps/adfs_v1x.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
MAP = {
55
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified",
66
"fro": {
7-
CLAIMS + "commonname": "commonName",
8-
CLAIMS + "emailaddress": "emailAddress",
9-
CLAIMS + "group": "group",
10-
CLAIMS + "upn": "upn",
7+
f"{CLAIMS}commonname": "commonName",
8+
f"{CLAIMS}emailaddress": "emailAddress",
9+
f"{CLAIMS}group": "group",
10+
f"{CLAIMS}upn": "upn",
1111
},
1212
"to": {
13-
"commonName": CLAIMS + "commonname",
14-
"emailAddress": CLAIMS + "emailaddress",
15-
"group": CLAIMS + "group",
16-
"upn": CLAIMS + "upn",
13+
"commonName": f"{CLAIMS}commonname",
14+
"emailAddress": f"{CLAIMS}emailaddress",
15+
"group": f"{CLAIMS}group",
16+
"upn": f"{CLAIMS}upn",
1717
},
1818
}

src/saml2/attributemaps/adfs_v20.py

+36-36
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,43 @@
77
MAP = {
88
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified",
99
"fro": {
10-
CLAIMS + "commonname": "commonName",
11-
CLAIMS + "group": "group",
12-
COM_WS_CLAIMS + "denyonlysid": "denyOnlySid",
13-
MS_CLAIMS + "authenticationmethod": "authenticationMethod",
14-
MS_CLAIMS + "denyonlyprimarygroupsid": "denyOnlyPrimaryGroupSid",
15-
MS_CLAIMS + "denyonlyprimarysid": "denyOnlyPrimarySid",
16-
MS_CLAIMS + "groupsid": "groupSid",
17-
MS_CLAIMS + "primarygroupsid": "primaryGroupSid",
18-
MS_CLAIMS + "primarysid": "primarySid",
19-
MS_CLAIMS + "role": "role",
20-
MS_CLAIMS + "windowsaccountname": "windowsAccountName",
21-
ORG_WS_CLAIMS + "emailaddress": "emailAddress",
22-
ORG_WS_CLAIMS + "givenname": "givenName",
23-
ORG_WS_CLAIMS + "name": "name",
24-
ORG_WS_CLAIMS + "nameidentifier": "nameId",
25-
ORG_WS_CLAIMS + "privatepersonalidentifier": "privatePersonalId",
26-
ORG_WS_CLAIMS + "surname": "surname",
27-
ORG_WS_CLAIMS + "upn": "upn",
10+
f"{CLAIMS}commonname": "commonName",
11+
f"{CLAIMS}group": "group",
12+
f"{COM_WS_CLAIMS}denyonlysid": "denyOnlySid",
13+
f"{MS_CLAIMS}authenticationmethod": "authenticationMethod",
14+
f"{MS_CLAIMS}denyonlyprimarygroupsid": "denyOnlyPrimaryGroupSid",
15+
f"{MS_CLAIMS}denyonlyprimarysid": "denyOnlyPrimarySid",
16+
f"{MS_CLAIMS}groupsid": "groupSid",
17+
f"{MS_CLAIMS}primarygroupsid": "primaryGroupSid",
18+
f"{MS_CLAIMS}primarysid": "primarySid",
19+
f"{MS_CLAIMS}role": "role",
20+
f"{MS_CLAIMS}windowsaccountname": "windowsAccountName",
21+
f"{ORG_WS_CLAIMS}emailaddress": "emailAddress",
22+
f"{ORG_WS_CLAIMS}givenname": "givenName",
23+
f"{ORG_WS_CLAIMS}name": "name",
24+
f"{ORG_WS_CLAIMS}nameidentifier": "nameId",
25+
f"{ORG_WS_CLAIMS}privatepersonalidentifier": "privatePersonalId",
26+
f"{ORG_WS_CLAIMS}surname": "surname",
27+
f"{ORG_WS_CLAIMS}upn": "upn",
2828
},
2929
"to": {
30-
"authenticationMethod": MS_CLAIMS + "authenticationmethod",
31-
"commonName": CLAIMS + "commonname",
32-
"denyOnlyPrimaryGroupSid": MS_CLAIMS + "denyonlyprimarygroupsid",
33-
"denyOnlyPrimarySid": MS_CLAIMS + "denyonlyprimarysid",
34-
"denyOnlySid": COM_WS_CLAIMS + "denyonlysid",
35-
"emailAddress": ORG_WS_CLAIMS + "emailaddress",
36-
"givenName": ORG_WS_CLAIMS + "givenname",
37-
"group": CLAIMS + "group",
38-
"groupSid": MS_CLAIMS + "groupsid",
39-
"name": ORG_WS_CLAIMS + "name",
40-
"nameId": ORG_WS_CLAIMS + "nameidentifier",
41-
"primaryGroupSid": MS_CLAIMS + "primarygroupsid",
42-
"primarySid": MS_CLAIMS + "primarysid",
43-
"privatePersonalId": ORG_WS_CLAIMS + "privatepersonalidentifier",
44-
"role": MS_CLAIMS + "role",
45-
"surname": ORG_WS_CLAIMS + "surname",
46-
"upn": ORG_WS_CLAIMS + "upn",
47-
"windowsAccountName": MS_CLAIMS + "windowsaccountname",
30+
"authenticationMethod": f"{MS_CLAIMS}authenticationmethod",
31+
"commonName": f"{CLAIMS}commonname",
32+
"denyOnlyPrimaryGroupSid": f"{MS_CLAIMS}denyonlyprimarygroupsid",
33+
"denyOnlyPrimarySid": f"{MS_CLAIMS}denyonlyprimarysid",
34+
"denyOnlySid": f"{COM_WS_CLAIMS}denyonlysid",
35+
"emailAddress": f"{ORG_WS_CLAIMS}emailaddress",
36+
"givenName": f"{ORG_WS_CLAIMS}givenname",
37+
"group": f"{CLAIMS}group",
38+
"groupSid": f"{MS_CLAIMS}groupsid",
39+
"name": f"{ORG_WS_CLAIMS}name",
40+
"nameId": f"{ORG_WS_CLAIMS}nameidentifier",
41+
"primaryGroupSid": f"{MS_CLAIMS}primarygroupsid",
42+
"primarySid": f"{MS_CLAIMS}primarysid",
43+
"privatePersonalId": f"{ORG_WS_CLAIMS}privatepersonalidentifier",
44+
"role": f"{MS_CLAIMS}role",
45+
"surname": f"{ORG_WS_CLAIMS}surname",
46+
"upn": f"{ORG_WS_CLAIMS}upn",
47+
"windowsAccountName": f"{MS_CLAIMS}windowsaccountname",
4848
},
4949
}

0 commit comments

Comments
 (0)