'Prepend sys.path with file\'s directory if not already included'

def prepend_syspath(self, filename):

    self.runcommand(('if    1:\n                                                _filename    =    %r\n                                                import    sys    as    _sys\n                                                from    os.path    import    dirname    as    _dirname\n                                                _dir    =    _dirname(_filename)\n                                                if    not    _dir    in    _sys.path:\n                                                                _sys.path.insert(0,    _dir)\n                                                del    _filename,    _sys,    _dirname,    _dir\n                                                \n' % (filename,)))
