from django.core.management.base import BaseCommand, CommandError

from fabric.api import local


class Command(BaseCommand):
    help = 'Runs pep8 on the entire project'

    def handle(self, *args, **options):
        local('find ../straymapper -name "*.py" | xargs pep8 --repeat',
            capture=False)

@@ -1,12 +1,23 @@
+import os%0A%0A
 from django.
@@ -59,22 +59,8 @@
 mand
-, CommandError
 %0A%0Afr
@@ -214,34 +214,125 @@
     
-local('find ../straymapper
+file_path = os.path.dirname(__file__)%0A        pep8_cmd = 'find ' + file_path%0A        pep8_cmd = pep8_cmd + '/../../..
  -na
@@ -363,17 +363,16 @@
 -repeat'
-,
 %0A       
@@ -372,19 +372,31 @@
         
-   
+local(pep8_cmd,
  capture

make pep8 devtools path generic