CMS 3D CMS Logo

Public Member Functions | Public Attributes

NodeCut::Match Class Reference

List of all members.

Public Member Functions

def __init__
def cut
def pathContaining
def selectManyNames
def selectOneName
def trimNames
def trimPaths

Public Attributes

 in_names
 in_paths
 out_edges
 out_names
 out_paths
 out_totals

Detailed Description

Definition at line 61 of file NodeCut.py.


Constructor & Destructor Documentation

def NodeCut::Match::__init__ (   self,
  pre_in,
  pre_out 
)

Definition at line 64 of file NodeCut.py.

00065                                        :
00066         self.in_names = pre_in + "names"
00067         self.in_paths = pre_in + "paths"
00068         self.out_names = pre_in + "names"
00069         self.out_paths = pre_in + "paths"
00070         self.out_edges = pre_out + "edges"
00071         self.out_totals = pre_out + "totals"


Member Function Documentation

def NodeCut::Match::cut (   matcher)

Definition at line 72 of file NodeCut.py.

00073                     :
00074         fin_names = open(self.in_names,'r')
00075         fout_names = open(self.out_names,'w')
00076         names = []
00077         for line in fin.names.xreadlines():
00078             n = NameLine(line)
00079             b = matcher(n)
00080             if b<0: break
00081             if b:
00082                 names[n.id()]
00083                 fout.write(line)
00084         return names

def NodeCut::Match::pathContaining (   id)

Definition at line 121 of file NodeCut.py.

00122                           :
00123         pass

def NodeCut::Match::selectManyNames (   ids)

Definition at line 107 of file NodeCut.py.

00108                             :
00109         fin_names = open(self.in_names,'r')
00110         fout_names = open(self.out_names,'w')
00111         names = {}
00112         for line in fin.names.xreadlines():
00113             a=line.split()
00114             if ids.get(int(a[0]))!=None:
00115                 fout.write(line)
        
def NodeCut::Match::selectOneName (   value)

Definition at line 85 of file NodeCut.py.

00086                             :
00087         fin_names = open(self.in_names,'r')
00088         fout_names = open(self.out_names,'w')
00089         names = {}
00090         for line in fin.names.xreadlines():
00091             a=line.split()
00092             if int(a[3])==value: break
00093         names[int(a[0])]=1
00094         fout.write(line)
00095         return names

def NodeCut::Match::trimNames (   cutoff)

Definition at line 96 of file NodeCut.py.

00097                          :
00098         fin_names = open(self.in_names,'r')
00099         fout_names = open(self.out_names,'w')
00100         names = []
00101         for line in fin.names.xreadlines():
00102             a=line.split()
00103             if int(a[3])<cuttoff: break
00104             names[int(a[0])]
00105             fout.write(line)
00106         return names

def NodeCut::Match::trimPaths (   cutoff)

Definition at line 116 of file NodeCut.py.

00117                          :
00118         fin_paths = open(self.in_paths,'r')
00119         fout_paths = open(self.out_paths,'w')
00120         self.tot_paths


Member Data Documentation

Definition at line 64 of file NodeCut.py.

Definition at line 64 of file NodeCut.py.

Definition at line 64 of file NodeCut.py.

Definition at line 64 of file NodeCut.py.

Definition at line 64 of file NodeCut.py.

Definition at line 64 of file NodeCut.py.