Пример #1
0
 def append_config_to_file(self, text, full_path_and_file):
     self.text = text
     self.fileName = full_path_and_file
     f = Filer()
     if os.path.exists(self.fileName):
         try :
             f.appendThisToFile(self.text, self.fileName)
         except OSError :
             print "Unable to append to file: {0}".format(self.fileName)
Пример #2
0
 def write_config_file(self, text, full_path_and_file):
     self.text = text
     self.path = full_path_and_file
     f = Filer()
     if not os.path.exists(self.path):
         try:
             os.makedirs(os.path.dirname(self.path))
         except OSError :
             print "Directory: {0} Exists".format(os.path.dirname(self.path))
     f.createFile(os.path.join(self.path))
     f.writeThisToFile(self.text)