parameters: (self, evt, fname=u'', lnum=-1)
docstring: Do the work of opening a file and placing it
          in a new notebook page.
          @keyword fname: can be optionally specified to open
                          a file without opening a FileDialog
          @keyword lnum: Explicitly set the line number to open the file to
docstring_summary: Do the work of opening a file and placing it
          in a new notebook page.
          @keyword fname: can be optionally specified to open
                          a file without opening a FileDialog
          @keyword lnum: Explicitly set the line number to open the file to
docstring_tokens: Do the work of opening a file and placing it in a new notebook page . @keyword fname : can be optionally specified to open a file without opening a FileDialog @keyword lnum : Explicitly set the line number to open the file to
function: def DoOpen(self, evt, fname=u'', lnum=-1):
          """ Do the work of opening a file and placing it
          in a new notebook page.
          @keyword fname: can be optionally specified to open
                          a file without opening a FileDialog
          @keyword lnum: Explicitly set the line number to open the file to
  
          """
          try:
              e_id = evt.GetId()
          except AttributeError:
              e_id = evt
  
          if e_id == ID_OPEN:
              fdir = self.GetNotebook().GetCurrentCtrl().GetFileName()
              if len(fdir):
                  fdir = os.path.dirname(fdir)
              elif not hasattr(sys, 'frozen'):
                  fdir = os.curdir
  
              dlg = wx.FileDialog(self, _("Editra: Open"), fdir, "",
                                  ''.join(syntax.GenFileFilters()),
                                  wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR)
              dlg.SetFilterIndex(_PGET('FFILTER', 'int', 0))
  
              if ebmlib.LockCall(self._mlock, dlg.ShowModal) == wx.ID_OK:
                  _PSET('FFILTER', dlg.GetFilterIndex())
                  for path in dlg.GetPaths():
                      if _PGET('OPEN_NW', default=False):
                          wx.GetApp().OpenNewWindow(path)
                      else:
                          self.nb.OpenPage(ebmlib.GetPathName(path),
                                           ebmlib.GetFileName(path))
                          self.nb.GoCurrentPage()
  
              dlg.Destroy()
          else:
              self.LOG("[ed_main][info] CMD Open File: %s" % fname)
              self.nb.OpenPage(ebmlib.GetPathName(fname),
                               ebmlib.GetFileName(fname), quiet=True)
              self.nb.GoCurrentPage()
  
              # lnum arg is only used with command line open
              if lnum >= 0:
                  buff = self.nb.GetCurrentCtrl()
                  buff.GotoLine(lnum)
  
              self.Raise()
function_tokens: def DoOpen ( self , evt , fname = u'' , lnum = - 1 ) : try : e_id = evt . GetId ( ) except AttributeError : e_id = evt if e_id == ID_OPEN : fdir = self . GetNotebook ( ) . GetCurrentCtrl ( ) . GetFileName ( ) if len ( fdir ) : fdir = os . path . dirname ( fdir ) elif not hasattr ( sys , 'frozen' ) : fdir = os . curdir dlg = wx . FileDialog ( self , _ ( "Editra: Open" ) , fdir , "" , '' . join ( syntax . GenFileFilters ( ) ) , wx . OPEN | wx . MULTIPLE | wx . CHANGE_DIR ) dlg . SetFilterIndex ( _PGET ( 'FFILTER' , 'int' , 0 ) ) if ebmlib . LockCall ( self . _mlock , dlg . ShowModal ) == wx . ID_OK : _PSET ( 'FFILTER' , dlg . GetFilterIndex ( ) ) for path in dlg . GetPaths ( ) : if _PGET ( 'OPEN_NW' , default = False ) : wx . GetApp ( ) . OpenNewWindow ( path ) else : self . nb . OpenPage ( ebmlib . GetPathName ( path ) , ebmlib . GetFileName ( path ) ) self . nb . GoCurrentPage ( ) dlg . Destroy ( ) else : self . LOG ( "[ed_main][info] CMD Open File: %s" % fname ) self . nb . OpenPage ( ebmlib . GetPathName ( fname ) , ebmlib . GetFileName ( fname ) , quiet = True ) self . nb . GoCurrentPage ( ) # lnum arg is only used with command line open if lnum >= 0 : buff = self . nb . GetCurrentCtrl ( ) buff . GotoLine ( lnum ) self . Raise ( )