Created
December 20, 2013 07:11
-
-
Save toastdriven/8051408 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import glob | |
import os | |
import re | |
old_method_syntax = re.compile('[A-Z][\w\d_]+\.[\w\d_]+\(self') | |
cwd = os.getcwd() | |
files = glob.glob(os.path.join(cwd, '*.py')) | |
files.extend(glob.glob(os.path.join(cwd, '*', '*.py'))) | |
files.extend(glob.glob(os.path.join(cwd, '*', '*', '*.py'))) | |
files.extend(glob.glob(os.path.join(cwd, '*', '*', '*', '*.py'))) | |
files.extend(glob.glob(os.path.join(cwd, '*', '*', '*', '*', '*.py'))) | |
files.extend(glob.glob(os.path.join(cwd, '*', '*', '*', '*', '*', '*.py'))) | |
files.extend(glob.glob(os.path.join(cwd, '*', '*', '*', '*', '*', '*', '*.py'))) | |
for search_me in files: | |
with open(search_me, 'r') as search: | |
for offset, line in enumerate(search): | |
if old_method_syntax.search(line): | |
print("{0} ({1}): {2}".format( | |
search_me.replace(cwd + '/', ''), | |
offset + 1, | |
line.strip() | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment