~ubuntu-branches/ubuntu/quantal/mago/quantal

« back to all changes in this revision

Viewing changes to mago/application/gucharmap.py

  • Committer: Bazaar Package Importer
  • Author(s): Ara Pulido
  • Date: 2010-12-03 16:08:32 UTC
  • Revision ID: james.westby@ubuntu.com-20101203160832-97pz2nxwmo54iwfk
Tags: 0.3-0ubuntu3
* Updated from trunk
 + Added new applications to our tests base
 + Fixes LP: #682845 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
PACKAGE = "mago"
 
2
 
 
3
#-*- coding:utf-8 -*-
 
4
"""
 
5
This is the "gucharmap" module.
 
6
 
 
7
This module provides a wrapper for LDTP to make writing Gucharmap tests easier.
 
8
"""
 
9
import ooldtp
 
10
import ldtp
 
11
import os
 
12
from .main import Application
 
13
from ..gconfwrapper import GConf
 
14
from ..cmd import globals
 
15
import time
 
16
import gettext
 
17
 
 
18
gettext.install (True)
 
19
gettext.bindtextdomain (PACKAGE, globals.LOCALE_SHARE)
 
20
gettext.textdomain (PACKAGE)
 
21
t = gettext.translation(PACKAGE, globals.LOCALE_SHARE, fallback = True)
 
22
_ = t.gettext
 
23
 
 
24
 
 
25
class Gucharmap(Application):
 
26
    """
 
27
    gucharmap manages the Gucharmap application.
 
28
    """
 
29
 
 
30
    LAUNCHER = 'gucharmap'
 
31
    LAUNCHER_ARGS = []
 
32
    WINDOW = 'frmCharacterMap'
 
33
 
 
34
    BTN_COPY = _('btnCopy')
 
35
    MNU_ABOUT = _('mnuAbout')
 
36
    MNU_BITSTREAMCHARTER = _('mnuBitstreamCharter')
 
37
    MNU_CENTURYSCHOOLBOOKL = _('mnuCenturySchoolbookL')
 
38
    MNU_CLOSE = _('mnuClose')
 
39
    MNU_CONTENTS = _('mnuContents')
 
40
    MNU_COURIER10PITCH = _('mnuCourier10Pitch')
 
41
    MNU_DEJAVUSANS = _('mnuDejaVuSans')
 
42
    MNU_DEJAVUSANSMONO = _('mnuDejaVuSansMono')
 
43
    MNU_DEJAVUSERIF = _('mnuDejaVuSerif')
 
44
    MNU_DINGBATS = _('mnuDingbats')
 
45
    MNU_EMPTY = _('mnuEmpty')
 
46
    MNU_EMPTY1 = _('mnuEmpty1')
 
47
    MNU_EMPTY2 = _('mnuEmpty2')
 
48
    MNU_EMPTY3 = _('mnuEmpty3')
 
49
    MNU_EMPTY4 = _('mnuEmpty4')
 
50
    MNU_FIND = _('mnuFind')
 
51
    MNU_FINDNEXT = _('mnuFindNext')
 
52
    MNU_FINDPREVIOUS = _('mnuFindPrevious')
 
53
    MNU_FREEMONO = _('mnuFreeMono')
 
54
    MNU_FREESANS = _('mnuFreeSans')
 
55
    MNU_FREESERIF = _('mnuFreeSerif')
 
56
    MNU_GARUDA = _('mnuGaruda')
 
57
    MNU_GETHELPONLINE = _('mnuGetHelpOnline')
 
58
    MNU_KACSTONE = _('mnuKacstOne')
 
59
    MNU_KEDAGE = _('mnuKedage')
 
60
    MNU_KHMEROS = _('mnuKhmerOS')
 
61
    MNU_KHMEROSSYSTEM = _('mnuKhmerOSSystem')
 
62
    MNU_KINNARI = _('mnuKinnari')
 
63
    MNU_LIBERATIONMONO = _('mnuLiberationMono')
 
64
    MNU_LIBERATIONSANS = _('mnuLiberationSans')
 
65
    MNU_LIBERATIONSERIF = _('mnuLiberationSerif')
 
66
    MNU_LOHITBENGALI = _('mnuLohitBengali')
 
67
    MNU_LOHITGUJARATI = _('mnuLohitGujarati')
 
68
    MNU_LOHITHINDI = _('mnuLohitHindi')
 
69
    MNU_LOHITPUNJABI = _('mnuLohitPunjabi')
 
70
    MNU_LOHITTAMIL = _('mnuLohitTamil')
 
71
    MNU_LOMA = _('mnuLoma')
 
72
    MNU_MALLIGE = _('mnuMallige')
 
73
    MNU_MEERA = _('mnuMeera')
 
74
    MNU_MONOSPACE = _('mnuMonospace')
 
75
    MNU_MUKTINARROW = _('mnuMuktiNarrow')
 
76
    MNU_NEXTCHARACTER = _('mnuNextCharacter')
 
77
    MNU_NEXTSCRIPT = _('mnuNextScript')
 
78
    MNU_NIMBUSMONOL = _('mnuNimbusMonoL')
 
79
    MNU_NIMBUSROMANNO9L = _('mnuNimbusRomanNo9L')
 
80
    MNU_NIMBUSSANSL = _('mnuNimbusSansL')
 
81
    MNU_NORASI = _('mnuNorasi')
 
82
    MNU_NORMALSIZE = _('mnuNormalSize')
 
83
    MNU_OPENSYMBOL = _('mnuOpenSymbol')
 
84
    MNU_PHETSARATHOT = _('mnuPhetsarathOT')
 
85
    MNU_POTHANA2000 = _('mnuPothana2000')
 
86
    MNU_PREVIOUSCHARACTER = _('mnuPreviousCharacter')
 
87
    MNU_PREVIOUSSCRIPT = _('mnuPreviousScript')
 
88
    MNU_PURISA = _('mnuPurisa')
 
89
    MNU_RACHANA = _('mnuRachana')
 
90
    MNU_REKHA = _('mnuRekha')
 
91
    MNU_REPORTAPROBLEM = _('mnuReportaProblem')
 
92
    MNU_SAAB = _('mnuSaab')
 
93
    MNU_SANS = _('mnuSans')
 
94
    MNU_SAWASDEE = _('mnuSawasdee')
 
95
    MNU_SERIF = _('mnuSerif')
 
96
    MNU_STANDARDSYMBOLSL = _('mnuStandardSymbolsL')
 
97
    MNU_SYMBOL = _('mnuSymbol')
 
98
    MNU_TAKAOPGOTHIC = _('mnuTakaoPGothic')
 
99
    MNU_TLWGMONO = _('mnuTlwgMono')
 
100
    MNU_TLWGTYPEWRITER = _('mnuTlwgTypewriter')
 
101
    MNU_TLWGTYPIST = _('mnuTlwgTypist')
 
102
    MNU_TLWGTYPO = _('mnuTlwgTypo')
 
103
    MNU_TRANSLATETHISAPPLICATION = _('mnuTranslateThisApplication')
 
104
    MNU_URWBOOKMANL = _('mnuURWBookmanL')
 
105
    MNU_URWCHANCERYL = _('mnuURWChanceryL')
 
106
    MNU_URWGOTHICL = _('mnuURWGothicL')
 
107
    MNU_URWPALLADIOL = _('mnuURWPalladioL')
 
108
    MNU_UBUNTU = _('mnuUbuntu')
 
109
    MNU_UMPUSH = _('mnuUmpush')
 
110
    MNU_UNBATANG = _('mnuUnBatang')
 
111
    MNU_UNDOTUM = _('mnuUnDotum')
 
112
    MNU_VEMANA2000 = _('mnuVemana2000')
 
113
    MNU_WAREE = _('mnuWaree')
 
114
    MNU_WENQUANYIMICROHEI = _('mnuWenQuanYiMicroHei')
 
115
    MNU_WENQUANYIMICROHEIMONO = _('mnuWenQuanYiMicroHeiMono')
 
116
    MNU_ZOOMIN = _('mnuZoomIn')
 
117
    MNU_ZOOMOUT = _('mnuZoomOut')
 
118
    MNU_GARGI = _('mnugargi')
 
119
    MNU_ORI1UNI = _('mnuori1Uni')
 
120
    TXT_0 = _('txt0')
 
121
    TXT_TEXTTOCOPY = _('txtTexttocopy')
 
122
 
 
123
 
 
124
    def runAboutdialog(self):
 
125
        """
 
126
        This basic test simply verifies that the application launches
 
127
        and that the UI reacts
 
128
        The About dialog is the only menu that is always present in the UI
 
129
        """
 
130
        if self.MNU_ABOUT:
 
131
            self.main_window.click(self.MNU_ABOUT)
 
132
 
 
133
            # Wait for the dialog to open
 
134
            # Name of about dialogs change with the app
 
135
            timeout=60
 
136
            dlgAbout=None
 
137
            while not ( timeout>0 and dlgAbout):
 
138
                dlgs=[ w for w in ldtp.getwindowlist() if w.startswith('dlgAbout')]
 
139
                if dlgs:
 
140
                    dlgAbout = dlgs[0]
 
141
                timeout -= 1
 
142
                time.sleep(1)
 
143
 
 
144
            if not dlgAbout:
 
145
                raise AssertionError('About Dialog not found')
 
146
 
 
147
 
 
148
            # Looking for a button to close the window
 
149
            found = None
 
150
            for btnClose in ('btnClose', 'btnOK', 'btnCancel'):
 
151
                try:
 
152
                    found = ldtp.getchild(dlgAbout, btnClose, 'push button')
 
153
                    break
 
154
                except:
 
155
                    pass
 
156
 
 
157
            if not found:
 
158
                return
 
159
 
 
160
            ldtp.click(dlgAbout, btnClose)
 
161
 
 
162
    def close(self):
 
163
        self.main_window.click(self.MNU_CLOSE)
 
164
    
 
165
    def __init__(self):
 
166
        Application.__init__(self)
 
167
        self.main_window = ooldtp.context(self.WINDOW)