call site 5 for path.local.remove
execnet/testing/test_rsync.py - line 148
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
   def test_file_disappearing(self):
       dest = self.dest1
       source = self.source 
       source.ensure("ex").write("a" * 100)
       source.ensure("ex2").write("a" * 100)
   
       class DRsync(RSync):
           def filter(self, x):
               assert x != source
               if x.endswith("ex2"):
                   self.x = 1
                   source.join("ex2").remove()
               return True
   
       rsync = DRsync(source)
       rsync.add_target(gw, dest)
->     rsync.send()
       assert rsync.x == 1
       assert len(dest.listdir()) == 1
       assert len(source.listdir()) == 1
execnet/rsync.py - line 102
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
   def send(self, raises=True):
       """ Sends a sourcedir to all added targets. Flag indicates
           whether to raise an error or return in case of lack of
           targets
           """
       if not self._channels:
           if raises:
               raise IOError("no targets available, maybe you "
                             "are trying call send() twice?")
           return
       # normalize a trailing '/' away
       self._sourcedir = os.path.dirname(os.path.join(self._sourcedir, 'x'))
       # send directory structure and file timestamps/sizes
->     self._send_directory_structure(self._sourcedir)
   
       # paths and to_send are only used for doing
       # progress-related callbacks
       self._paths = {}
       self._to_send = {}
   
       # send modified file to clients
       while self._channels:
           channel, req = self._receivequeue.get()
           if req is None:
               self._end_of_channel(channel)
           else:
               command, data = req
               if command == "links":
                   self._process_link(channel)
               elif command == "done":
                   self._done(channel)
               elif command == "ack":
                   if self._callback:
                       self._callback("ack", self._paths[data], channel)
               elif command == "list_done":
                   self._list_done(channel)
               elif command == "send":
                   self._send_item(channel, data)
                   del data
               else:
                   assert "Unknown command %s" % command
execnet/rsync.py - line 189
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
   def _send_directory_structure(self, path):
       try:
           st = os.lstat(path)
       except OSError:
           self._broadcast((0, 0))
           return
       if stat.S_ISREG(st.st_mode):
           # regular file: send a timestamp/size pair
           self._broadcast((st.st_mtime, st.st_size))
       elif stat.S_ISDIR(st.st_mode):
->         self._send_directory(path)
       elif stat.S_ISLNK(st.st_mode):
           self._send_link_structure(path)
       else:
           raise ValueError, "cannot sync %r" % (path,)
execnet/rsync.py - line 159
153
154
155
156
157
158
159
160
161
162
163
164
   def _send_directory(self, path):
       # dir: send a list of entries
       names = []
       subpaths = []
       for name in os.listdir(path):
           p = os.path.join(path, name)
->         if self.filter(p):
               names.append(name)
               subpaths.append(p)
       self._broadcast(names)
       for p in subpaths:
           self._send_directory_structure(p)
execnet/testing/test_rsync.py - line 143
139
140
141
142
143
144
   def filter(self, x):
       assert x != source
       if x.endswith("ex2"):
           self.x = 1
->         source.join("ex2").remove()
       return True