Added aiguillage on login
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Thu, 26 Jul 2012 11:56:59 +0000 (11:56 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Thu, 26 Jul 2012 11:56:59 +0000 (11:56 +0000)
go.py

diff --git a/go.py b/go.py
index 75d37231c2374f3dbae821388f9f09c7ff7f992f..8a406e3f102bada2015bfea2c4e3441237593d9c 100755 (executable)
--- a/go.py
+++ b/go.py
@@ -111,11 +111,17 @@ def download():
     #print(httpresponse.info())
     open('welcome3.html', 'w', encoding='iso8859-1').write(html)
     
+    assert 'init-aiguillagePersonnalisation.ea' in html
+    httpresponse = httpopen(BASE_URL + '/voscomptes/canalXHTML/donneesPersonnelles/aiguillage_personnalisation/init-aiguillagePersonnalisation.ea')
+    html = httpresponse.read().decode('iso8859-1')
+    #print(httpresponse.info())
+    open('welcome4.html', 'w', encoding='iso8859-1').write(html)
+
     assert 'init-synthese.ea' in html
     httpresponse = httpopen(BASE_URL + '/voscomptes/canalXHTML/comptesCommun/synthese_assurancesEtComptes/init-synthese.ea')
     html = httpresponse.read().decode('iso8859-1')
     #print(httpresponse.info())
-    open('welcome4.html', 'w', encoding='iso8859-1').write(html)
+    open('welcome5.html', 'w', encoding='iso8859-1').write(html)
     sleep(3)
 
     root = html_parser.html_parse(html)
@@ -198,6 +204,7 @@ def agregate():
         logging.debug('Agregating %s', account)
 
         if os.access(LOCAL_DIR + account + '.csv', os.F_OK):
+            logging.debug('Not implemented')
             pass
         else:
             logging.warning('Master csv file not found for %s: creating', account)
@@ -205,6 +212,7 @@ def agregate():
 
             past_headers = False
             for line in open(LOCAL_DIR + account_file).read().split('\n'):
+                logging.debug('line: %s', line)
                 if not line:
                     continue
                 if past_headers:
@@ -219,6 +227,9 @@ if __name__ == '__main__':
     parser.add_option('-d', '--debug',
         action='store_true', dest='debug', default=False,
         help="debug mode")
+    parser.add_option('--no-download',
+        action='store_true', dest='no_download', default=False,
+        help="don't download. Only agregate.")
     (options, args) = parser.parse_args()
 
     if options.debug:
@@ -237,5 +248,6 @@ if __name__ == '__main__':
             raise
     os.chdir(TMP_DIR)
 
-    download()
+    if not options.no_download:
+        download()
     agregate()