Skip to content

Commit

Permalink
Merge pull request USTC-Resource#8 from cclauss/patch-1
Browse files Browse the repository at this point in the history
Travis CI: Use flake8 to find syntax errors and undefined names
  • Loading branch information
heqin-zhu authored Apr 4, 2019
2 parents fd40e0d + 1f02990 commit 6d8c780
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ env:

install:
- pip install --upgrade pip
- pip install markdown pypinyin
- pip install flake8 markdown pypinyin

script:
- flake8 . --count --select=E9,F63,F72,F82 --show-source --statistics
- python utils/genReadme.py
- python utils/genIndex.py

Expand Down
2 changes: 1 addition & 1 deletion 数据结构/codes/mbinary/graph/adjacentList.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self):
self.edges = {}
def __getitem__(self,i):
return self.vertexs[i]
def __setitem__(selfi,x):
def __setitem__(self, i,x):
self.vertexs[i]= x
def __iter__(self):
return iter(self.vertexs)
Expand Down
2 changes: 1 addition & 1 deletion 数据结构/codes/mbinary/graph/directed.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self):
self.edges = {}
def __getitem__(self,i):
return self.vertexs[i]
def __setitem__(selfi,x):
def __setitem__(self,i,x):
self.vertexs[i]= x
def __iter__(self):
return iter(self.vertexs.values())
Expand Down
2 changes: 1 addition & 1 deletion 数据结构/codes/mbinary/graph/undirected.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self):
self.edges = {}
def __getitem__(self,i):
return self.vertexs[i]
def __setitem__(selfi,x):
def __setitem__(self,i,x):
self.vertexs[i]= x
def __iter__(self):
return iter(self.vertexs)
Expand Down
2 changes: 1 addition & 1 deletion 数据结构/labs/2017/navigation/directed.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self):
self.edges = {}
def __getitem__(self,i):
return self.vertexs[i]
def __setitem__(selfi,x):
def __setitem__(self,i,x):
self.vertexs[i]= x
def __iter__(self):
return iter(self.vertexs.values())
Expand Down
2 changes: 1 addition & 1 deletion 数据结构/labs/2017/navigation/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self):
self.edges = {}
def __getitem__(self,i):
return self.vertexs[i]
def __setitem__(selfi,x):
def __setitem__(self,i,x):
self.vertexs[i]= x
def __iter__(self):
return iter(self.vertexs)
Expand Down
8 changes: 4 additions & 4 deletions 数理逻辑/codes/mbinary/system_L.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

NON = sympy.Symbol('~')
CONTAIN = sympy.Symbol('>')
AND = sympy .Symbol('&')
OR = sysmpy.Symbol('|')
EQUAL = sysmpy.Symbol('-')
AND = sympy.Symbol('&')
OR = sympy.Symbol('|')
EQUAL = sympy.Symbol('-')
LEFT = sympy.Symbol('(')
RIGHT = sympy.Symbol(')')

Expand Down Expand Up @@ -217,7 +217,7 @@ def l3(self,p,q):
return contain(left,right)
def genFormula(self,s:str)->formula:
s=s.replace('~~','') # simplify the deduction, to do
s=s.replace('<->','-')
s=s.replace('<->','-')
s=s.replace('->','>')
li = re.findall(r'[\(\)\>\~]|\w+',s)
li = [sympy.Symbol(i) for i in li]
Expand Down

0 comments on commit 6d8c780

Please sign in to comment.