mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:36:07 -04:00
Make scripts/ and scripts-dev/ pass pyflakes (and the rest of the codebase on py3) (#4068)
This commit is contained in:
parent
81d4f51524
commit
e1728dfcbe
27 changed files with 511 additions and 518 deletions
|
@ -1,18 +1,17 @@
|
|||
#! /usr/bin/python
|
||||
|
||||
import ast
|
||||
import argparse
|
||||
import ast
|
||||
import os
|
||||
import sys
|
||||
|
||||
import yaml
|
||||
|
||||
PATTERNS_V1 = []
|
||||
PATTERNS_V2 = []
|
||||
|
||||
RESULT = {
|
||||
"v1": PATTERNS_V1,
|
||||
"v2": PATTERNS_V2,
|
||||
}
|
||||
RESULT = {"v1": PATTERNS_V1, "v2": PATTERNS_V2}
|
||||
|
||||
|
||||
class CallVisitor(ast.NodeVisitor):
|
||||
def visit_Call(self, node):
|
||||
|
@ -21,7 +20,6 @@ class CallVisitor(ast.NodeVisitor):
|
|||
else:
|
||||
return
|
||||
|
||||
|
||||
if name == "client_path_patterns":
|
||||
PATTERNS_V1.append(node.args[0].s)
|
||||
elif name == "client_v2_patterns":
|
||||
|
@ -42,8 +40,10 @@ def find_patterns_in_file(filepath):
|
|||
parser = argparse.ArgumentParser(description='Find url patterns.')
|
||||
|
||||
parser.add_argument(
|
||||
"directories", nargs='+', metavar="DIR",
|
||||
help="Directories to search for definitions"
|
||||
"directories",
|
||||
nargs='+',
|
||||
metavar="DIR",
|
||||
help="Directories to search for definitions",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue