Beispiel #1
0
 def readFile(self, file):
     # open file
     f = open(file, "r")
     # create project obj
     p = Project()
     # for each line in the file
     for line in f.readlines():
         # split by the ":"
         split = line.split(":")
         # assign attributes
         if split[0] == "ProjectName":
             p.projectName = split[1]
         elif split[0] == "LastWorkedOn":
             p.lastWorkedOn = split[1]
         elif split[0] == "Path":
             p.projectPath = split[1]
             p.gitLog = self.getLogFile(p.projectPath)
         elif split[0] == "Description":
             p.projectDescription = split[1]
         elif split[0] == "WhereDidILeaveIt":
             p.whereDidILeaveIt = split[1]
         elif split[0] == "NextSteps":
             p.nextSteps = split[1]
     # close the file!
     f.close()
     # return created project
     return p