Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
idlelib.FileList.FileList Class Reference
Inheritance diagram for idlelib.FileList.FileList:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def open
def gotofileline
def new
def close_all_callback
def unregister_maybe_terminate
def filename_changed_edit
def canonize

Public Attributes

 root
 dict
 inversedict
 vars

Detailed Description

Definition at line 6 of file FileList.py.


Constructor & Destructor Documentation

def idlelib.FileList.FileList.__init__ (   self,
  root 
)

Definition at line 11 of file FileList.py.

00011 
00012     def __init__(self, root):
00013         self.root = root
00014         self.dict = {}
00015         self.inversedict = {}
00016         self.vars = {} # For EditorWindow.getrawvar (shared Tcl variables)

Here is the caller graph for this function:


Member Function Documentation

def idlelib.FileList.FileList.canonize (   self,
  filename 
)

Definition at line 102 of file FileList.py.

00102 
00103     def canonize(self, filename):
00104         if not os.path.isabs(filename):
00105             try:
00106                 pwd = os.getcwd()
00107             except os.error:
00108                 pass
00109             else:
00110                 filename = os.path.join(pwd, filename)
00111         return os.path.normpath(filename)
00112 

Here is the caller graph for this function:

def idlelib.FileList.FileList.close_all_callback (   self,
  args,
  kwds 
)

Definition at line 51 of file FileList.py.

00051 
00052     def close_all_callback(self, *args, **kwds):
00053         for edit in list(self.inversedict):
00054             reply = edit.close()
00055             if reply == "cancel":
00056                 break
00057         return "break"

Definition at line 70 of file FileList.py.

00070 
00071     def filename_changed_edit(self, edit):
00072         edit.saved_change_hook()
00073         try:
00074             key = self.inversedict[edit]
00075         except KeyError:
00076             print("Don't know this EditorWindow object.  (rename)")
00077             return
00078         filename = edit.io.filename
00079         if not filename:
00080             if key:
00081                 del self.dict[key]
00082             self.inversedict[edit] = None
00083             return
00084         filename = self.canonize(filename)
00085         newkey = os.path.normcase(filename)
00086         if newkey == key:
00087             return
00088         if newkey in self.dict:
00089             conflict = self.dict[newkey]
00090             self.inversedict[conflict] = None
00091             tkMessageBox.showerror(
00092                 "Name Conflict",
00093                 "You now have multiple edit windows open for %r" % (filename,),
00094                 master=self.root)
00095         self.dict[newkey] = edit
00096         self.inversedict[edit] = newkey
00097         if key:
00098             try:
00099                 del self.dict[key]
00100             except KeyError:
00101                 pass

Here is the call graph for this function:

def idlelib.FileList.FileList.gotofileline (   self,
  filename,
  lineno = None 
)

Definition at line 43 of file FileList.py.

00043 
00044     def gotofileline(self, filename, lineno=None):
00045         edit = self.open(filename)
00046         if edit is not None and lineno is not None:
00047             edit.gotoline(lineno)

Here is the call graph for this function:

def idlelib.FileList.FileList.new (   self,
  filename = None 
)

Definition at line 48 of file FileList.py.

00048 
00049     def new(self, filename=None):
00050         return self.EditorWindow(self, filename)

Here is the caller graph for this function:

def idlelib.FileList.FileList.open (   self,
  filename,
  action = None 
)

Definition at line 17 of file FileList.py.

00017 
00018     def open(self, filename, action=None):
00019         assert filename
00020         filename = self.canonize(filename)
00021         if os.path.isdir(filename):
00022             # This can happen when bad filename is passed on command line:
00023             tkMessageBox.showerror(
00024                 "File Error",
00025                 "%r is a directory." % (filename,),
00026                 master=self.root)
00027             return None
00028         key = os.path.normcase(filename)
00029         if key in self.dict:
00030             edit = self.dict[key]
00031             edit.top.wakeup()
00032             return edit
00033         if action:
00034             # Don't create window, perform 'action', e.g. open in same window
00035             return action(filename)
00036         else:
00037             edit = self.EditorWindow(self, filename, key)
00038             if edit.good_load:
00039                 return edit
00040             else:
00041                 edit._close()
00042                 return None

Here is the call graph for this function:

Definition at line 58 of file FileList.py.

00058 
00059     def unregister_maybe_terminate(self, edit):
00060         try:
00061             key = self.inversedict[edit]
00062         except KeyError:
00063             print("Don't know this EditorWindow object.  (close)")
00064             return
00065         if key:
00066             del self.dict[key]
00067         del self.inversedict[edit]
00068         if not self.inversedict:
00069             self.root.quit()


Member Data Documentation

Definition at line 13 of file FileList.py.

Definition at line 14 of file FileList.py.

Definition at line 12 of file FileList.py.

Definition at line 15 of file FileList.py.


The documentation for this class was generated from the following file: