Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P7131
dupe_settings.py
Active
Public
Actions
Authored by
Legoktm
on May 15 2018, 5:48 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F18282673: dupe_settings.py
May 15 2018, 5:48 PM
2018-05-15 17:48:43 (UTC+0)
Subscribers
None
#!/usr/bin/env python3
from
collections
import
defaultdict
import
glob
import
json
E
=
'/home/km/gerrit/mediawiki/core/extensions'
g
=
sorted
(
glob
.
glob
(
E
+
'/*/extension.json'
))
data
=
defaultdict
(
set
)
def
check
(
key
,
new
):
for
n
,
s
in
data
.
items
():
if
key
in
s
:
print
(
'ERROR:
%s
:
%s
already set by
%s
'
%
(
new
,
key
,
n
))
for
fname
in
g
:
#print(fname)
with
open
(
fname
)
as
f
:
j
=
json
.
load
(
f
)
if
'config'
in
j
:
name
=
j
[
'name'
]
for
k
,
v
in
j
[
'config'
]
.
items
():
if
k
.
startswith
(
'@'
)
or
k
==
'_prefix'
:
continue
check
(
k
,
name
)
data
[
name
]
.
add
(
k
)
Event Timeline
Legoktm
created this paste.
May 15 2018, 5:48 PM
2018-05-15 17:48:43 (UTC+0)
Legoktm
mentioned this in
T194405: Make all extensions compatible with latest changes to ExtensionRegistration
.
Log In to Comment