scripts/github_stats.py
def remove_date(self, file_path='', date=str(datetime.date.today())):
        """
        Removes all rows of the associated date from the given csv file.
        Defaults to today.
        """
        languages_exists = os.path.isfile(file_path)
        if languages_exists:
            with open(file_path, 'rb') as inp, open('temp.csv', 'wb') as out:
                writer = csv.writer(out)
                for row in csv.reader(inp):
                    if row[0] != date:
                        writer.writerow(row)
            inp.close()
            out.close()
            os.remove(file_path)
            os.rename("temp.csv",file_path)
def remove_date(self, file_path='', date=str(datetime.date.today())):
        languages_exists = os.path.isfile(file_path)
        if languages_exists:
            with open(file_path, 'rb') as inp, open('temp.csv', 'wb') as out:
                writer = csv.writer(out)
                for row in csv.reader(inp):
                    if row[0] != date:
                        writer.writerow(row)
            inp.close()
            out.close()
            os.remove(file_path)
            os.rename("temp.csv",file_path)
def remove_date ( self , file_path = '' , date = str ( datetime . date . today ( ) ) ) : languages_exists = os . path . isfile ( file_path ) if languages_exists : with open ( file_path , 'rb' ) as inp , open ( 'temp.csv' , 'wb' ) as out : writer = csv . writer ( out ) for row in csv . reader ( inp ) : if row [ 0 ] != date : writer . writerow ( row ) inp . close ( ) out . close ( ) os . remove ( file_path ) os . rename ( "temp.csv" , file_path )
Removes all rows of the associated date from the given csv file.
        Defaults to today.
Removes all rows of the associated date from the given csv file . Defaults to today .