Changeset 4275

Show
Ignore:
Timestamp:
03/05/09 01:22:36 (4 years ago)
Author:
gpolo
Message:

Some tweaks.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/setup.py

    r4273 r4275  
    44# Copyright (C) 2007-2008 Adriano Monteiro Marques 
    55# 
    6 # Author: Adriano Monteiro Marques <adriano@umitproject.org> 
     6# Authors: Adriano Monteiro Marques <adriano@umitproject.org> 
     7#          Guilherme Polo <ggpolo@gmail.com> 
    78# 
    89# This program is free software; you can redistribute it and/or modify 
     
    117118 
    118119        (ICONS_DIR, 
    119             glob(os.path.join('share', 'icons', 'umit', '*.ico')) + 
    120             glob(os.path.join('share', 'icons', 'umit', '*.png'))), 
     120            glob(os.path.join(ICONS_DIR, '*.ico')) + 
     121            glob(os.path.join(ICONS_DIR, '*.png'))), 
    121122 
    122123        (DOCS_DIR, 
     
    154155            full_path = os.path.join(path , "LC_MESSAGES", "umit.mo") 
    155156            self.mkpath(os.path.dirname(full_path)) 
    156             self.announce("Compiling %s -> %s" % (t[0],full_path)) 
     157            self.announce("Compiling %s -> %s" % (t[0], full_path)) 
    157158            msgfmt.make(t[0], full_path, False) 
    158159        # like guess 
     
    181182        uninstaller_filename = os.path.join( 
    182183                self.install_scripts, "uninstall_umit") 
    183         uninstaller = """#!/usr/bin/env python 
    184 import os, os.path, sys 
    185  
    186 print 
    187 print '%(line)s Uninstall Umit %(version)s %(line)s' 
    188 print 
    189  
    190 answer = raw_input('Are you sure that you want to completly uninstall \ 
    191 Umit %(version)s? (yes/no) ') 
    192  
    193 if answer != 'yes' and answer != 'y': 
    194     sys.exit(0) 
    195  
    196 print 
    197 print '%(line)s Uninstalling Umit %(version)s... %(line)s' 
    198 print 
    199 """ % {'version':VERSION, 'line':'-'*10} 
     184        uninstaller = [] 
     185        uninstaller.append( 
     186                "#!/usr/bin/env python\n" 
     187                "import os, sys\n" 
     188                "\n" 
     189                "print\n" 
     190                "print '%(line)s Uninstall Umit %(version)s %(line)s'\n" 
     191                "print\n" 
     192                "\n" 
     193                "answer = raw_input('Are you sure that you want to '\n" 
     194                "        'completly uninstall Umit %(version)s? (yes/no) ')\n" 
     195                "\n" 
     196                "if answer.lower() not in ['yes', 'y']:\n" 
     197                "    sys.exit(0)\n" 
     198                "\n" 
     199                "print\n" 
     200                "print '%(line)s Uninstalling Umit %(version)s... %(line)s'\n" 
     201                "print\n" % {'version': VERSION, 'line': '-' * 10}) 
    200202 
    201203        for output in self.get_outputs(): 
    202             uninstaller += "print 'Removing %s...'\n" % output 
    203             uninstaller += "if os.path.exists('%s'): os.remove('%s')\n" % \ 
    204                         (output, output) 
    205  
    206         uninstaller += "print 'Removing uninstaller itself...'\n" 
    207         uninstaller += "os.remove('%s')\n" % uninstaller_filename 
     204            uninstaller.append( 
     205                    "print 'Removing %(output)s...'\n" 
     206                    "if os.path.exists('%(output)s'):\n" 
     207                    "    os.remove('%(output)s')\n" % {'output': output}) 
     208 
     209        uninstaller.append( 
     210                "print 'Removing uninstaller itself...'\n" 
     211                "os.remove('%s')\n" % uninstaller_filename) 
    208212 
    209213        uninstaller_file = open(uninstaller_filename, 'w') 
    210         uninstaller_file.write(uninstaller) 
     214        uninstaller_file.writelines(uninstaller) 
    211215        uninstaller_file.close() 
    212216 
     
    349353    cmdclasses.update(py2exe_cmdclass) 
    350354 
    351 standard_options = dict( 
     355options = dict( 
    352356        name = 'umit', 
    353357        license = 'GNU GPL (version 2 or later)', 
     
    382386 
    383387if py2exe_options: 
    384     standard_options.update(py2exe_options) 
     388    options.update(py2exe_options) 
    385389 
    386390if py2app_options: 
    387     standard_options.update(py2app_options) 
    388  
    389 setup(**standard_options) 
     391    options.update(py2app_options) 
     392 
     393setup(**options)