2018-11-21 00:06:51 +01:00
|
|
|
#!/usr/bin/env python
|
2019-07-12 08:46:20 +02:00
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
__metaclass__ = type
|
2018-11-21 00:06:51 +01:00
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
MAIN_DISPLAY_IMPORT = 'from __main__ import display'
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
for path in sys.argv[1:] or sys.stdin.read().splitlines():
|
|
|
|
with open(path, 'r') as f:
|
|
|
|
for i, line in enumerate(f.readlines()):
|
|
|
|
if MAIN_DISPLAY_IMPORT in line:
|
|
|
|
lineno = i + 1
|
|
|
|
colno = line.index(MAIN_DISPLAY_IMPORT) + 1
|
|
|
|
print('%s:%d:%d: Display is a singleton, just import and instantiate' % (path, lineno, colno))
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|