scripts/github_stats.py
def write_languages(self, file_path='',date=str(datetime.date.today())):
        """
        Updates languages.csv file with current data.
        """
        self.remove_date(file_path=file_path, date=date)
        languages_exists = os.path.isfile(file_path)
        with open(file_path, 'a') as out_languages:
            if not languages_exists:
                out_languages.write('date,language,count,size,size_log\n')
            languages_sorted = sorted(self.languages_size)
            #self.delete_last_line(date=date, file_path=file_path)
            for language in languages_sorted:
                try:
                    out_languages.write(date + ',' + language + ','
                        + str(self.languages[language]) + ','
                        + str(self.languages_size[language]) + ','
                        + str(math.log10(int(self.languages_size[language])))
                        + '\n')
                except (TypeError, KeyError) as e:
                    out_languages.write(date + ',' + language + ','
                        + str(0) + ','
                        + str(self.languages_size[language]) + ','
                        + str(math.log10(int(self.languages_size[language])))
                        + '\n')
def write_languages(self, file_path='',date=str(datetime.date.today())):
        """
        Updates languages.csv file with current data.
        """
        self.remove_date(file_path=file_path, date=date)
        languages_exists = os.path.isfile(file_path)
        with open(file_path, 'a') as out_languages:
            if not languages_exists:
                out_languages.write('date,language,count,size,size_log\n')
            languages_sorted = sorted(self.languages_size)
            #self.delete_last_line(date=date, file_path=file_path)
            for language in languages_sorted:
                try:
                    out_languages.write(date + ',' + language + ','
                        + str(self.languages[language]) + ','
                        + str(self.languages_size[language]) + ','
                        + str(math.log10(int(self.languages_size[language])))
                        + '\n')
                except (TypeError, KeyError) as e:
                    out_languages.write(date + ',' + language + ','
                        + str(0) + ','
                        + str(self.languages_size[language]) + ','
                        + str(math.log10(int(self.languages_size[language])))
                        + '\n')
def write_languages ( self , file_path = '' , date = str ( datetime . date . today ( ) ) ) : self . remove_date ( file_path = file_path , date = date ) languages_exists = os . path . isfile ( file_path ) with open ( file_path , 'a' ) as out_languages : if not languages_exists : out_languages . write ( 'date,language,count,size,size_log\n' ) languages_sorted = sorted ( self . languages_size ) #self.delete_last_line(date=date, file_path=file_path) for language in languages_sorted : try : out_languages . write ( date + ',' + language + ',' + str ( self . languages [ language ] ) + ',' + str ( self . languages_size [ language ] ) + ',' + str ( math . log10 ( int ( self . languages_size [ language ] ) ) ) + '\n' ) except ( TypeError , KeyError ) as e : out_languages . write ( date + ',' + language + ',' + str ( 0 ) + ',' + str ( self . languages_size [ language ] ) + ',' + str ( math . log10 ( int ( self . languages_size [ language ] ) ) ) + '\n' )
Updates languages.csv file with current data.
Updates languages . csv file with current data .