#NEWLINE# def update( self ) : #NEWLINE# #INDENT# if ( 'USERNAME' in os . environ ) : #NEWLINE# #INDENT# self . projectUser = os . environ [ 'USERNAME' ] #NEWLINE# #UNINDENT# _cfgFile = os . path . join ( self . projectRoot , ( self . projectName + '.do' ) ) #NEWLINE# cSettings = ( self . readCfg ( _cfgFile ) or self . initGlobalDo ( ) ) #NEWLINE# if cSettings : #NEWLINE# #INDENT# if ( ( self . lastCfgFile != _cfgFile ) or ( self . lastProjectHeader != cSettings [ 0 ] . head ) ) : #NEWLINE# #INDENT# cSettings [ 0 ] . file = _cfgFile #NEWLINE# self . lastCfgFile = cSettings [ 0 ] . file #NEWLINE# self . lastProjectHeader = cSettings [ 0 ] . head #NEWLINE# self . settings = cSettings #NEWLINE# if ( not os . path . isfile ( _cfgFile ) ) : #NEWLINE# #INDENT# print ( "TypeTodo init: Writing project's config." ) #NEWLINE# try : #NEWLINE# #INDENT# with codecs . open ( _cfgFile , 'w+' , 'UTF-8' ) as f : #NEWLINE# #INDENT# f . write ( self . lastProjectHeader ) #NEWLINE# f . write ( '\n' ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# None #NEWLINE# #UNINDENT# #UNINDENT# return True #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# print ( 'TypeTodo error: Config could not be read.' ) #NEWLINE# self . lastCfgFile = None #NEWLINE# self . lastProjectHeader = None