~mvo/ubuntu-sso-client/strawman-lp711413

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Natalia B. Bidart
  • Date: 2012-02-07 01:46:58 UTC
  • mto: (812.1.39 ubuntu-sso-client)
  • mto: This revision was merged to the branch mainline in revision 824.
  • Revision ID: natalia.bidart@canonical.com-20120207014658-z8tod0cq8y097pjj
- Install ui files consitently between Gtk and Qt (part of LP: #927994).

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
# with this program.  If not, see <http://www.gnu.org/licenses/>.
21
21
"""Setup.py: build, distribute, clean."""
22
22
 
23
 
# pylint: disable=W0404, W0511
 
23
# pylint: disable=W0404
24
24
 
25
25
import distutils
26
26
import os
40
40
 
41
41
POT_FILE = 'po/ubuntu-sso-client.pot'
42
42
SERVICE_FILE = 'data/com.ubuntu.sso.service'
 
43
CONSTANTS = 'ubuntu_sso/constants.py'
43
44
 
44
 
CLEANFILES = [SERVICE_FILE, POT_FILE, 'MANIFEST']
 
45
CLEANFILES = [SERVICE_FILE, POT_FILE, CONSTANTS, 'MANIFEST']
45
46
QT_UI_DIR = os.path.join('ubuntu_sso', 'qt', 'ui')
46
47
 
47
48
 
48
49
def replace_prefix(prefix):
49
50
    """Replace every '@prefix@' with prefix within 'filename' content."""
50
 
    # replace .service file
51
 
    for filename in (SERVICE_FILE,):
 
51
    # replace .service file, DATA_DIR constant
 
52
    for filename in (SERVICE_FILE, CONSTANTS):
52
53
        with open(filename + '.in') as in_file:
53
54
            content = in_file.read()
54
55
            with open(filename, 'w') as out_file:
327
328
    def run(self, *args):
328
329
        """Dummy."""
329
330
 
 
331
 
330
332
if sys.platform == 'win32':
331
333
    cmdclass['build_i18n'] = dummy_build_i18n
332
334
 
364
366
          'bin/ubuntu-sso-login-gtk',
365
367
          'bin/ubuntu-sso-login-qt']),
366
368
        ('share/dbus-1/services', ['data/com.ubuntu.sso.service']),
367
 
        ('share/ubuntu-sso-client/data/gtk', ['data/gtk/ui.glade']),
368
369
    ]
369
370
    extra = {}
370
371
 
382
383
    data_files=data_files,
383
384
    packages=[
384
385
        'ubuntu_sso',
 
386
        'ubuntu_sso.tests',
385
387
        'ubuntu_sso.gtk',
386
388
        'ubuntu_sso.keyring',
 
389
        'ubuntu_sso.keyring.tests',
387
390
        'ubuntu_sso.main',
 
391
        'ubuntu_sso.main.tests',
388
392
        'ubuntu_sso.networkstate',
 
393
        'ubuntu_sso.networkstate.tests',
389
394
        'ubuntu_sso.qt',
390
395
        'ubuntu_sso.qt.ui',
391
396
        'ubuntu_sso.utils',
 
397
        'ubuntu_sso.utils.tests',
392
398
        'ubuntu_sso.utils.webclient',
 
399
        'ubuntu_sso.utils.webclient.tests',
393
400
        'ubuntu_sso.xdg_base_directory',
 
401
        'ubuntu_sso.xdg_base_directory.tests',
394
402
    ],
395
403
    cmdclass=cmdclass,
396
404
    **extra)