Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
21351820
Unverified
Commit
21351820
authored
2 years ago
by
David Robertson
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove `list_url_patterns` dev script (#12349)
parent
b7762b0c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/12349.misc
+1
-0
1 addition, 0 deletions
changelog.d/12349.misc
mypy.ini
+0
-1
0 additions, 1 deletion
mypy.ini
scripts-dev/list_url_patterns.py
+0
-60
0 additions, 60 deletions
scripts-dev/list_url_patterns.py
with
1 addition
and
61 deletions
changelog.d/12349.misc
0 → 100644
+
1
−
0
View file @
21351820
Remove unused and broken dev script `list_url_patterns.py`.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
mypy.ini
+
0
−
1
View file @
21351820
...
@@ -28,7 +28,6 @@ exclude = (?x)
...
@@ -28,7 +28,6 @@ exclude = (?x)
|scripts-dev/definitions.py
|scripts-dev/definitions.py
|scripts-dev/federation_client.py
|scripts-dev/federation_client.py
|scripts-dev/hash_history.py
|scripts-dev/hash_history.py
|scripts-dev/list_url_patterns.py
|scripts-dev/release.py
|scripts-dev/release.py
|scripts-dev/tail-synapse.py
|scripts-dev/tail-synapse.py
...
...
This diff is collapsed.
Click to expand it.
scripts-dev/list_url_patterns.py
deleted
100755 → 0
+
0
−
60
View file @
b7762b0c
#! /usr/bin/python
import
argparse
import
ast
import
os
import
sys
import
yaml
PATTERNS_V1
=
[]
PATTERNS_V2
=
[]
RESULT
=
{
"
v1
"
:
PATTERNS_V1
,
"
v2
"
:
PATTERNS_V2
}
class
CallVisitor
(
ast
.
NodeVisitor
):
def
visit_Call
(
self
,
node
):
if
isinstance
(
node
.
func
,
ast
.
Name
):
name
=
node
.
func
.
id
else
:
return
if
name
==
"
client_patterns
"
:
PATTERNS_V2
.
append
(
node
.
args
[
0
].
s
)
def
find_patterns_in_code
(
input_code
):
input_ast
=
ast
.
parse
(
input_code
)
visitor
=
CallVisitor
()
visitor
.
visit
(
input_ast
)
def
find_patterns_in_file
(
filepath
):
with
open
(
filepath
)
as
f
:
find_patterns_in_code
(
f
.
read
())
parser
=
argparse
.
ArgumentParser
(
description
=
"
Find url patterns.
"
)
parser
.
add_argument
(
"
directories
"
,
nargs
=
"
+
"
,
metavar
=
"
DIR
"
,
help
=
"
Directories to search for definitions
"
,
)
args
=
parser
.
parse_args
()
for
directory
in
args
.
directories
:
for
root
,
_
,
files
in
os
.
walk
(
directory
):
for
filename
in
files
:
if
filename
.
endswith
(
"
.py
"
):
filepath
=
os
.
path
.
join
(
root
,
filename
)
find_patterns_in_file
(
filepath
)
PATTERNS_V1
.
sort
()
PATTERNS_V2
.
sort
()
yaml
.
dump
(
RESULT
,
sys
.
stdout
,
default_flow_style
=
False
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment