ufload3 2.2__tar.gz → 2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ufload3
3
- Version: 2.2
3
+ Version: 2.5
4
4
  Summary: UniField python3 loader
5
5
  Author: MSF
6
6
  Project-URL: Homepage, https://github.com/Unifield/ufload3
@@ -1,7 +1,7 @@
1
1
  from . import cloud; assert cloud
2
2
  from . import db; assert db
3
3
 
4
- __version__ = '2.2'
4
+ __version__ = '2.5'
5
5
 
6
6
  # null progress, can be overridden by importers
7
7
  def _progress(p):
@@ -94,7 +94,15 @@ def psql(args, sql, db='postgres', silent=False):
94
94
 
95
95
  def psql_file(args, file, db='postgres', silent=False):
96
96
  return _run(args, mkpsql_file(args, file, db), silent)
97
-
97
+
98
+ def _check_column_exists(args, table, column, db):
99
+ v = _run(args, mkpsql(args, """SELECT c.relname
100
+ FROM pg_class c, pg_attribute a
101
+ WHERE c.relname='%s' AND a.attname='%s' AND c.oid=a.attrelid;""" % (table, column), db), get_out=True)
102
+ if v and v[0] == 0:
103
+ return v[1].strip()
104
+ return False
105
+
98
106
  def load_zip_into(args, db, f, sz):
99
107
  if sz == 0:
100
108
  ufload3.progress("Note: No progress percent available.")
@@ -391,6 +399,13 @@ def delive(args, db):
391
399
 
392
400
  rc = psql(args, 'alter table sync_client_sync_server_connection ADD COLUMN IF NOT EXISTS ufload_automatic_patching_prod_value boolean;', db)
393
401
  rc = psql(args, 'update sync_client_sync_server_connection set ufload_automatic_patching_prod_value=automatic_patching;', db)
402
+
403
+ rc = psql(args, 'alter table users_last_login ADD COLUMN IF NOT EXISTS date_prod_value timestamp without time zone;', db)
404
+ rc = psql(args, 'update users_last_login set date_prod_value=date;', db)
405
+
406
+ rc = psql(args, 'alter table res_users ADD COLUMN IF NOT EXISTS user_email_prod_value varchar(240);', db)
407
+ rc = psql(args, 'update res_users set user_email_prod_value=user_email;', db)
408
+
394
409
  rc = psql(args, 'update sync_client_sync_server_connection set automatic_patching = \'f\', protocol = \'xmlrpc\', login = \'%s\', database = \'%s\', host = \'127.0.0.1\', port = %d;' % (adminuser, ss, port), db)
395
410
  if rc != 0:
396
411
  return rc
@@ -414,14 +429,23 @@ def delive(args, db):
414
429
  if rc != 0:
415
430
  return rc
416
431
  # Automated import settings
417
- psql(args, 'UPDATE automated_import SET report_path=\'\', src_path=\'\', ftp_url=\'\', dest_path=\'\', ftp_ok=\'f\', ftp_port=\'\',dest_path_failure=\'\', ftp_login=\'\', ftp_password=\'\', ftp_protocol=\'\';', db)
432
+ psql(args, 'UPDATE automated_import SET active=\'f\', report_path=\'\', src_path=\'\', ftp_url=\'\', dest_path=\'\', ftp_ok=\'f\', ftp_port=\'\',dest_path_failure=\'\', ftp_login=\'\', ftp_password=\'\', ftp_protocol=\'\';', db)
433
+
434
+ if _check_column_exists(args, "automated_import", "sharepoint_cert", db):
435
+ psql(args, 'UPDATE automated_import SET sharepoint_cert=NULL;', db)
436
+
437
+ if _check_column_exists(args, "msf_instance", "cloud_cert_content", db):
438
+ psql(args, 'UPDATE msf_instance SET cloud_cert_content=NULL;', db)
439
+
440
+ if _check_column_exists(args, "automated_import", "email_notification_type", db):
441
+ psql(args, 'UPDATE automated_import set email=NULL, email2=NULL, email3=NULL;', db)
418
442
 
419
443
  # Automated export jobs
420
444
  rc = psql(args, 'update ir_cron set active = \'f\' where model = \'automated.export\';', db)
421
445
  if rc != 0:
422
446
  return rc
423
447
  # Automated export settings
424
- psql(args, 'UPDATE automated_export SET report_path=\'\', ftp_url=\'\', dest_path=\'\', ftp_ok=\'f\', ftp_port=\'\',dest_path_failure=\'\', ftp_login=\'\', ftp_password=\'\', ftp_protocol=\'\';', db)
448
+ psql(args, 'UPDATE automated_export SET active=\'f\', report_path=\'\', ftp_url=\'\', dest_path=\'\', ftp_ok=\'f\', ftp_port=\'\',dest_path_failure=\'\', ftp_login=\'\', ftp_password=\'\', ftp_protocol=\'\';', db)
425
449
 
426
450
  # Now we check for arguments allowing auto-sync and silent-upgrade
427
451
  if args.autosync:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ufload3
3
- Version: 2.2
3
+ Version: 2.5
4
4
  Summary: UniField python3 loader
5
5
  Author: MSF
6
6
  Project-URL: Homepage, https://github.com/Unifield/ufload3
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes