filename = os.path.basename(file_item) filepath = os.path.join(location, filename) if not os.path.isfile(filepath): continue print 'REMOVE: ' + filepath os.system('rm -rf ' + filepath) print 'Desktop database update: ', os.system('update-desktop-database') print 'DONE!' else: print 'sK1 installation is not found!' sys.exit(0) elif sys.argv[1] == 'update_pot': paths = ['src/sk1', 'src/uc2'] po.build_pot(paths, 'po-sk1/sk1.pot', False) sys.exit(0) elif sys.argv[1] == 'build_locales': src_path = 'po-sk1' dest_path = 'src/sk1/share/locales' po.build_locales(src_path, dest_path, 'sk1') sys.exit(0) # Preparing start script src_script = 'src/script/sk1.tmpl' dst_script = 'src/script/sk1' fileptr = open(src_script, 'rb') fileptr2 = open(dst_script, 'wb') while True: line = fileptr.readline()
filepath = os.path.join(location, filename) if not os.path.isfile(filepath): continue log.info('REMOVE: %s', filepath) os.system('rm -rf ' + filepath) if os.system('update-desktop-database'): log.info('Desktop database update: DONE') else: log.error('Desktop database update: ERROR') else: log.warning('Color Picker installation is not found!') sys.exit(0) elif sys.argv[1] == 'update_pot': paths = ['src/cp2', 'src/uc2'] po.build_pot(paths, 'po-cp2/cp2.pot', False) sys.exit(0) elif sys.argv[1] == 'build_locales': build_locales() sys.exit(0) # Preparing start script src_script = 'src/_script/sk1-color-picker.tmpl' dst_script = 'src/_script/sk1-color-picker' with open(src_script, 'r') as fileptr: tmpl = string.Template(fileptr.read()) console_scripts = tmpl.safe_substitute(APP_INSTALL_PATH=install_path) with open(dst_script, 'w') as fileptr: