5
This is the "brasero" module.
7
This module provides a wrapper for LDTP to make writing Brasero tests easier.
12
from .main import Application
13
from ..gconfwrapper import GConf
14
from ..cmd import globals
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)
25
class Brasero(Application):
27
brasero manages the Brasero application.
32
WINDOW = 'frmBrasero*'
34
DLG_SELECT_FILES = _('dlgSelectFiles')
35
DLG_LOCATION_FOR = _('dlgLocationforImageFile')
36
DLG_CREATINGIMAGE = _('dlgCreatingImage')
43
BTN_ADD1 = _('btnAdd1')
44
BTN_ADD2 = _('btnAdd2')
45
BTN_BURN = _('btnBurn*')
46
BTN_CLOSE = _('btnClose')
47
BTN_CREATEFOLDER = _('btnCreateFolder')
48
BTN_CREATEIMAGE = _('btnCreateImage')
49
BTN_DOWNPATH = _('btnDownPath')
50
BTN_EMPTYPROJECT = _('btnEmptyProject')
51
BTN_REMOVE = _('btnRemove')
52
BTN_REMOVE1 = _('btnRemove1')
53
BTN_REMOVE2 = _('btnRemove2')
54
BTN_UPPATH = _('btnUpPath')
55
BTN_ZOOMIN = _('btnZoomIn')
56
BTN_ZOOMOUT = _('btnZoomOut')
57
BTN_TYPE_A_FILENAME = _('btnTypeafilename')
58
MNU_ABOUT = _('mnuAbout')
59
MNU_ADDFILES = _('mnuAddFiles')
60
MNU_ALLFILES = _('mnuAllfiles')
61
MNU_AUDIOFILES = _('mnuAudiofiles')
62
MNU_BLANK___ = _('mnuBlank...')
63
MNU_BROWSETHEFILESYSTEM = _('mnuBrowsethefilesystem')
64
MNU_BURNIMAGE___ = _('mnuBurnImage...')
65
MNU_BURN___ = _('mnuBurn...')
66
MNU_CHECKINTEGRITY___ = _('mnuCheckIntegrity...')
67
MNU_CONTENTS = _('mnuContents')
68
MNU_COPYDISC___ = _('mnuCopyDisc...')
69
MNU_COVEREDITOR = _('mnuCoverEditor')
70
MNU_DISPLAYPLAYLISTSANDTHEIRCONTENTS = _('mnuDisplayplaylistsandtheircontents')
71
MNU_EJECT = _('mnuEject')
72
MNU_EMPTY = _('mnuEmpty')
73
MNU_EMPTY1 = _('mnuEmpty1')
74
MNU_EMPTY2 = _('mnuEmpty2')
75
MNU_EMPTY3 = _('mnuEmpty3')
76
MNU_EMPTY4 = _('mnuEmpty4')
77
MNU_EMPTY5 = _('mnuEmpty5')
78
MNU_EMPTYPROJECT = _('mnuEmptyProject')
79
MNU_GETHELPONLINE = _('mnuGetHelpOnline')
80
MNU_IMAGEFILE = _('mnuImageFile')
81
MNU_IMAGEFILES = _('mnuImagefiles')
82
MNU_MOVIES = _('mnuMovies')
83
MNU_NEWAUDIOPROJECT = _('mnuNewAudioProject')
84
MNU_NEWDATAPROJECT = _('mnuNewDataProject')
85
MNU_NEWVIDEOPROJECT = _('mnuNewVideoProject')
86
MNU_NOITEMSFOUND = _('mnuNoitemsfound')
87
MNU_OPEN___ = _('mnuOpen...')
88
MNU_PLUGINS = _('mnuPlugins')
89
MNU_QUIT = _('mnuQuit')
90
MNU_REMOVEFILES = _('mnuRemoveFiles')
91
MNU_REPORTAPROBLEM = _('mnuReportaProblem')
92
MNU_SAVE = _('mnuSave')
93
MNU_SAVEAS___ = _('mnuSaveAs...')
94
MNU_TRANSLATETHISAPPLICATION = _('mnuTranslateThisApplication')
97
TXT_LOCATION = _('txtLocation')
98
TXT_NAME = _('txtName')
100
def burn_path_to_iso(self, path_to_burn, iso_tmp_path):
101
brasero = ooldtp.context(self.name)
103
# Click on the new data project menu item
104
brasero.getchild(self.MNU_NEWDATAPROJECT).selectmenuitem()
106
# Click on the Add Files button
107
brasero.getchild(self.BTN_ADD).click()
109
#Select the files with the path previously assigned on the xml file. (data/)
110
if (ldtp.guiexist(self.DLG_SELECT_FILES)):
111
selectFiles = ooldtp.context(self.DLG_SELECT_FILES)
112
if not (selectFiles.getchild(self.TXT_LOCATION)):
113
ldtp.generatekeyevent('<ctrl>l')
114
textLocation = selectFiles.getchild(self.TXT_LOCATION)
115
textLocation.settextvalue(path_to_burn)
116
ldtp.generatekeyevent('<return>')
118
# Go back to Brasero window and click on Burn.
119
ldtp.waittillguiexist(self.WINDOW)
120
brasero.getchild(self.BTN_BURN).click()
122
# wait for the dialog and enter the tmp path for the ISO previously assigned on the xml file.
123
ldtp.waittillguiexist(self.DLG_LOCATION_FOR)
125
if (ldtp.guiexist(self.DLG_LOCATION_FOR)):
126
location = ooldtp.context(self.DLG_LOCATION_FOR)
127
textISO = location.getchild(self.TXT_NAME)
128
textISO.settextvalue(iso_tmp_path)
129
if (location.getchild(self.BTN_CREATEIMAGE)):
130
location.getchild(self.BTN_CREATEIMAGE).click()
132
ldtp.generatekeyevent('<return>')
134
ldtp.generatekeyevent('<return>')
136
#Create the image and wait for the last dialog.
137
ldtp.waittillguiexist(self.DLG_CREATINGIMAGE)
138
creatingImage = ooldtp.context(self.DLG_CREATINGIMAGE)
139
#Wait till the Close button is available, during the burn process only a Cancel button is shown to the user.
140
ldtp.waittillguiexist(self.DLG_CREATINGIMAGE, self.BTN_CLOSE)
141
creatingImage.getchild(self.BTN_CLOSE).click()
142
ldtp.waittillguiexist(self.WINDOW)
145
Application.__init__(self)