briandk / gitvisualizations

A suite of visualization tools for analyzing files in git
http://briandk.com/codetimeline_demos/simulator/simulator.html
3 stars 3 forks source link

Cleaning up filepaths should be centralized #49

Open briandk opened 11 years ago

briandk commented 11 years ago

Considering moving this function (used by CodeTimeline and RepoStatistics) to its own module so other modules can access it:

def sanitize_filepath(self, filepath):
    filepath = os.path.expanduser(filepath)
    if os.path.isabs(filepath) == False:
        filepath = os.path.join(os.getcwd(), filepath)
    filepath = os.path.normpath(filepath)
    return filepath

Don't forget to remove the self argument.