Make mypy happy
This commit is contained in:
parent
36e312ba7b
commit
7e3c4d3ff9
@ -113,7 +113,7 @@ completer = SimpleCompleter(
|
|||||||
'_DIFFERENCE ', '_JOIN ', '_LJOIN ', '_RJOIN ', '_FJOIN ', '_PROJECTION ', '_RENAME_TO ', '_SELECTION ', '_RENAME ', '_DIVISION '])
|
'_DIFFERENCE ', '_JOIN ', '_LJOIN ', '_RJOIN ', '_FJOIN ', '_PROJECTION ', '_RENAME_TO ', '_SELECTION ', '_RENAME ', '_DIVISION '])
|
||||||
|
|
||||||
|
|
||||||
def load_relation(filename: str, defname:Optional[str]=None) -> Optional[str]:
|
def load_relation(filename: str, defname: Optional[str]) -> Optional[str]:
|
||||||
'''
|
'''
|
||||||
Loads a relation into the set. Defname is the given name
|
Loads a relation into the set. Defname is the given name
|
||||||
to the relation.
|
to the relation.
|
||||||
@ -123,7 +123,7 @@ def load_relation(filename: str, defname:Optional[str]=None) -> Optional[str]:
|
|||||||
'''
|
'''
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
print(colorize(
|
print(colorize(
|
||||||
"%s is not a file" % filename, ERROR_COLOR), file=sys.stderr)
|
f'{filename} is not a file', ERROR_COLOR), file=sys.stderr)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if defname is None:
|
if defname is None:
|
||||||
@ -216,10 +216,9 @@ def exec_line(command: str) -> None:
|
|||||||
return
|
return
|
||||||
|
|
||||||
filename = pars[1]
|
filename = pars[1]
|
||||||
|
defname = None
|
||||||
if len(pars) > 2:
|
if len(pars) > 2:
|
||||||
defname = pars[2]
|
defname = pars[2]
|
||||||
else:
|
|
||||||
defname = None
|
|
||||||
load_relation(filename, defname)
|
load_relation(filename, defname)
|
||||||
|
|
||||||
elif command.startswith('UNLOAD '):
|
elif command.startswith('UNLOAD '):
|
||||||
@ -320,7 +319,7 @@ def main(files=[]):
|
|||||||
"; Completion is activated using the tab (if supported by the terminal)")
|
"; Completion is activated using the tab (if supported by the terminal)")
|
||||||
|
|
||||||
for i in files:
|
for i in files:
|
||||||
load_relation(i)
|
load_relation(i, None)
|
||||||
|
|
||||||
readline.set_completer(completer.complete)
|
readline.set_completer(completer.complete)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user