def author_from_git(self):
        """ Get the author name from git information. """
        self.author = None
        try:
            encoding = locale.getdefaultlocale()[1]
            # launch git command and get answer
            cmd = Popen(["git", "config", "--get", "user.name"], stdout=PIPE)
            stdoutdata = cmd.communicate().decode(encoding)
            if (stdoutdata[0]):
                import ipdb;ipdb.set_trace()
                author = stdoutdata[0].rstrip(os.linesep)
                self.author = author#.decode('utf8')
        except ImportError:
            pass
        except CalledProcessError:
            pass
        except OSError:
            pass

        return self.author
def author_from_git ( self ) : self . author = None try : encoding = locale . getdefaultlocale ( ) [ 1 ] cmd = Popen ( [ "git" , "config" , "--get" , "user.name" ] , stdout = PIPE ) stdoutdata = cmd . communicate ( ) . decode ( encoding ) if ( stdoutdata [ 0 ] ) : import ipdb ; ipdb . set_trace ( ) author = stdoutdata [ 0 ] . rstrip ( os . linesep ) self . author = author except ImportError : pass except CalledProcessError : pass except OSError : pass return self . author
Get the author name from git information.