Stewart86 / roadtaxTracker

CRUD operation for a fleet of vehicle in Singapore to ease roadtax renewal
MIT License
8 stars 35 forks source link

The Function `csv_writer()` does not generate new file if not exist #19

Closed Stewart86 closed 4 years ago

Stewart86 commented 4 years ago

csv_writer should create a new file if it doesn't exist.

imanvanassum commented 4 years ago

This is a really easy fix ( w -> w+ as the param for open ) but after going through the code, this function seems to never get called anywhere? It's defined in vehicleGen, but never invoked.

Depending on what the function is supposed to do append may be better than write, to prevent overwriting contents.

Stewart86 commented 4 years ago

Yup, I reckon so, but just maybe let someone else try fixing it as a coding practice.

this function only get called by using the terminal. It is to generate a list of dummy vehicles for people to play with (instead of a empty database). For now, appending or writing doesn't matter much unless someone want to mix a list of dummy vehicles with their own?

sakshatshinde commented 4 years ago

Fixed this issue, and created a pull request : Here

Stewart86 commented 4 years ago

@sakshatshinde Thank for the pull request.