Esempio n. 1
0
def file_path(filename):
    realFile = filename
    realFile = search_file(filename, [CF.D.HOTFIXDIR, '/usr/bin'],
                           exit_if_not_found=False) or realFile
    realFile = search_file(filename + '.py', [CF.D.HOTFIXDIR, '/usr/bin'],
                           exit_if_not_found=False) or realFile
    return realFile
Esempio n. 2
0
    def __init__(self, rootobj, uixml_file, uirootname=None):
        self.rootobj = rootobj
        # magic.installer-->btnnext_do() will remove these classname from steps.
        # Added by zy_sunshine
        self.skip_stepnames = []

        self.values = rootobj.values.documentElement  # Just a short cut.
        self.uixml_path = search_file(uixml_file, [CF.D.HOTFIXDIR, '.'],
                                      postfix='UIxml')
        uixml = parse(self.uixml_path)
        ### hack to add a debug title
        rootnode = None
        if not uirootname:
            uixml_rootnode = uixml.documentElement
        else:
            uixml_rootnodes = uixml.getElementsByTagName(uirootname)
            if uixml_rootnodes == []:
                uixml_rootnode = uixml.documentElement
            else:
                for uixml_rootnode in uixml_rootnodes[0].childNodes:
                    if uixml_rootnode.nodeType == uixml_rootnode.ELEMENT_NODE:
                        break
        newdom = parseString(
            '<vbox margin="4"><label name="dbgmsg" line_wrap="true" fill="true" text="test label"/></vbox>'
        ).documentElement
        #uixml_rootnode.appendChild(newdom)     # TODO: open for debug
        xmlgtk.xmlgtk.__init__(self, uixml, uirootname)
        self.fill_values(self.values)
        self.stepid = None
        self.confdir = ''
        self.pypath = ''
Esempio n. 3
0
 def __init__(self, rootobj, uixml_file, uirootname=None):
     self.rootobj = rootobj
     # magic.installer-->btnnext_do() will remove these classname from steps.
     # Added by zy_sunshine
     self.skip_stepnames = []
     
     self.values = rootobj.values.documentElement # Just a short cut.
     self.uixml_path = search_file(uixml_file,
                              [CF.D.HOTFIXDIR, '.'],
                              postfix = 'UIxml')
     uixml = parse(self.uixml_path)
     ### hack to add a debug title
     rootnode = None
     if not uirootname:
         uixml_rootnode = uixml.documentElement
     else:
         uixml_rootnodes = uixml.getElementsByTagName(uirootname)
         if uixml_rootnodes == []:
             uixml_rootnode = uixml.documentElement
         else:
             for uixml_rootnode in uixml_rootnodes[0].childNodes:
                 if uixml_rootnode.nodeType == uixml_rootnode.ELEMENT_NODE:
                     break
     newdom = parseString('<vbox margin="4"><label name="dbgmsg" line_wrap="true" fill="true" text="test label"/></vbox>').documentElement
     #uixml_rootnode.appendChild(newdom)     # TODO: open for debug
     xmlgtk.xmlgtk.__init__(self, uixml, uirootname)
     self.fill_values(self.values)
     self.stepid = None
     self.confdir = ''
     self.pypath = ''
Esempio n. 4
0
def TestTaDialog():
    import gtk
    from mi.utils.common import search_file
    uixml_file = 'takeactions.xml'
    uixml_path = search_file( uixml_file,
                              [CF.D.HOTFIXDIR, '.'],
                              postfix = 'UIxml')
    uixmldoc = parse(uixml_path)
    tadlg = TaDialog(None, uixmldoc, 'actions.dialog')
    tadlg.name_map['otname'].set_text('')
    tadlg.name_map['otprog'].set_fraction(1)
    tadlg.name_map['frame_other'].set_sensitive(False)
    #import pdb; pdb.set_trace()
    #tadlg.topwin.destroy()
    gtk.main()
Esempio n. 5
0
 def __init__(self, step_name_list, *args, **kw):
     gtk.Window.__init__(self, *args, **kw)
     self.set_name(self.__class__.__name__)
     self.top = MITop(self)
     self.leftpanel = MILeftPanel(self, _('Steps'))
     self.rightpanel = MIRightPanel(self, '')
     self.statusbar = MIStatusBar(self)
     self.buttonbar = MIButtonBar(self)
     self.set_title(_('Magic Installer'))
     self.set_border_width(4)
     self.connect('destroy', lambda x: gtk.main_quit())
     self.values = parse(search_file('magic.values.xml', [CF.D.HOTFIXDIR, '.']))
     self.tm = MiTaskman(1325, self.statusbar.get_progressbar(),
                       self.statusbar.get_progressbar())
     self.step_name_list = step_name_list
Esempio n. 6
0
 def __init__(self, step_name_list, *args, **kw):
     gtk.Window.__init__(self, *args, **kw)
     self.set_name(self.__class__.__name__)
     self.xml_obj = MainXmlUi(self)
     
     self.leftpanel = self.xml_obj.leftpanel
     self.rightpanel = self.xml_obj.rightpanel
     self.statusbar = self.xml_obj.statusbar
     self.buttonbar = self.xml_obj.buttonbar
     
     self.set_title(_('Magic Installer'))
     self.set_border_width(4)
     self.connect('destroy', lambda x: gtk.main_quit())
     self.values = parse(search_file('magic.values.xml', [CF.D.HOTFIXDIR, '.']))
     self.tm = MiTaskman(1325, self.statusbar.get_progressbar(),
                       self.statusbar.get_progressbar(), self.err_dialog)
     self.step_name_list = step_name_list
     self.popup_dialog_list = []
Esempio n. 7
0
    def __init__(self, step_name_list, *args, **kw):
        gtk.Window.__init__(self, *args, **kw)
        self.set_name(self.__class__.__name__)
        self.xml_obj = MainXmlUi(self)

        self.leftpanel = self.xml_obj.leftpanel
        self.rightpanel = self.xml_obj.rightpanel
        self.statusbar = self.xml_obj.statusbar
        self.buttonbar = self.xml_obj.buttonbar

        self.set_title(_('Magic Installer'))
        self.set_border_width(4)
        self.connect('destroy', lambda x: gtk.main_quit())
        self.values = parse(
            search_file('magic.values.xml', [CF.D.HOTFIXDIR, '.']))
        self.tm = MiTaskman(1325, self.statusbar.get_progressbar(),
                            self.statusbar.get_progressbar(), self.err_dialog)
        self.step_name_list = step_name_list
        self.popup_dialog_list = []
Esempio n. 8
0
 def __init__(self, xmlgtk_class):
     self.tm = MiTaskman_Fake()
     self.values = parse(search_file('magic.values.xml', ['.']))
     self.xmlgtk_class = xmlgtk_class
Esempio n. 9
0
def file_path(filename):
    realFile = filename
    realFile = search_file(filename, [CF.D.HOTFIXDIR, '/usr/bin'], exit_if_not_found = False) or realFile
    realFile = search_file(filename+'.py', [CF.D.HOTFIXDIR, '/usr/bin'], exit_if_not_found = False) or realFile
    return realFile
Esempio n. 10
0
 def __init__(self, *args, **kw):
     gtk.Window.__init__(self, *args, **kw)
     self.values = parse(search_file('magic.values.xml', [CF.D.HOTFIXDIR, '.']))
     self.connect('destroy', lambda x: gtk.main_quit())
     self.tm = FakeTaskManager()
Esempio n. 11
0
 def __init__(self, xmlgtk_class):
     self.tm = MiTaskman_Fake()
     self.values = parse(search_file('magic.values.xml', ['.']))
     self.xmlgtk_class = xmlgtk_class