update_config.py
branchv0.7.x
changeset 643 df1e3b67882a
parent 623 d7101e496795
child 645 fcc3f100e56a
equal deleted inserted replaced
642:4cd9d0a9f42f 643:df1e3b67882a
     4 # See COPYING for distribution information.
     4 # See COPYING for distribution information.
     5 
     5 
     6 import os
     6 import os
     7 os.sys.path.remove(os.sys.path[0])
     7 os.sys.path.remove(os.sys.path[0])
     8 from time import time
     8 from time import time
     9 from ConfigParser import ConfigParser
     9 from configparser import ConfigParser
    10 from shutil import copy2
    10 from shutil import copy2
    11 
    11 
    12 pre_060 = False
    12 pre_060 = False
    13 
    13 
    14 try:
    14 try:
   159     cp = get_cfg_parser(cf)
   159     cp = get_cfg_parser(cf)
   160     update(cp)
   160     update(cp)
   161     if len(sect_opt):
   161     if len(sect_opt):
   162         update_cfg_file(cp, cf)
   162         update_cfg_file(cp, cf)
   163         sect_opt.sort()
   163         sect_opt.sort()
   164         print 'Please have a look at your configuration: %s' % cf
   164         print('Please have a look at your configuration: %s' % cf)
   165         print 'This are your Modified/Renamed/New settings:'
   165         print('This are your Modified/Renamed/New settings:')
   166         for s_o, st in sect_opt:
   166         for s_o, st in sect_opt:
   167             print '%s   %s = %s' % (st, s_o, get_option(cp, s_o))
   167             print('%s   %s = %s' % (st, s_o, get_option(cp, s_o)))
   168         if had_config:
   168         if had_config:
   169             print '\nRemoved section "config" with option "done" (obsolte)'
   169             print('\nRemoved section "config" with option "done" (obsolte)')
   170         if had_gid_mail:
   170         if had_gid_mail:
   171             print '\nRemoved option "gid_mail" from section "misc" (obsolte)\n'
   171             print('\nRemoved option "gid_mail" from section "misc"',
       
   172                   '(obsolte)\n')
   172         os.sys.exit(0)
   173         os.sys.exit(0)
   173     if had_config or had_gid_mail:
   174     if had_config or had_gid_mail:
   174         update_cfg_file(cp, cf)
   175         update_cfg_file(cp, cf)
   175         if had_config:
   176         if had_config:
   176             print '\nRemoved section "config" with option "done" (obsolte)'
   177             print('\nRemoved section "config" with option "done" (obsolte)')
   177         if had_gid_mail:
   178         if had_gid_mail:
   178             print '\nRemoved option "gid_mail" from section "misc" (obsolte)\n'
   179             print('\nRemoved option "gid_mail" from section "misc"',
       
   180                   '(obsolte)\n')