#NEWLINE# def config( ) : #NEWLINE# #INDENT# if os . path . isdir ( configurationDirectory ) : #NEWLINE# #INDENT# shutil . rmtree ( configurationDirectory ) #NEWLINE# #UNINDENT# os . makedirs ( configurationDirectory ) #NEWLINE# print ( 'Welcome to Orphilia, an open-source crossplatform Dropbox client.\nIn few steps, you will configure your Dropbox account to be used with Orphilia.' ) #NEWLINE# config = SafeConfigParser ( ) #NEWLINE# config . read ( ( configurationDirectory + '/config.ini' ) ) #NEWLINE# config . add_section ( 'main' ) #NEWLINE# config . add_section ( 'notifications' ) #NEWLINE# if ( sys . platform [ : 5 ] == 'haiku' ) : #NEWLINE# #INDENT# notifier = 'orphilia_haiku-notify' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# notifier = raw_input ( 'Enter notify method: ' ) #NEWLINE# config . set ( 'notifications' , 'notifier' , notifier ) #NEWLINE# #UNINDENT# dropboxPath = raw_input ( 'Dropbox folder location (optional):' ) #NEWLINE# if ( dropboxPath == '' ) : #NEWLINE# #INDENT# dropboxPath = os . path . normpath ( ( home + '/Dropbox' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# config . set ( 'main' , 'path' , dropboxPath ) #NEWLINE# if ( not os . path . exists ( dropboxPath ) ) : #NEWLINE# #INDENT# os . makedirs ( dropboxPath ) #NEWLINE# #UNINDENT# import orphiliaclient #NEWLINE# uid = orphiliaclient . client . client ( [ 'uid' ] ) #NEWLINE# config . set ( 'main' , 'uid' , uid ) #NEWLINE# with open ( ( configurationDirectory + '/config.ini' ) , 'w' ) as f : #NEWLINE# #INDENT# config . write ( f ) #NEWLINE# #UNINDENT# print ( 'Configuration files has been created.' )