Lines Matching refs:self
75 def __init__(self, server): argument
76 super(ShutdownHandler, self).__init__()
77 self.server = server
78 self.shutdown_event = threading.Event()
80 def __enter__(self): argument
81 self.start()
82 signal.signal(signal.SIGINT, self._sighandler)
83 signal.signal(signal.SIGTERM, self._sighandler)
85 def __exit__(self, *_): argument
87 self.shutdown_event.set()
89 self.join()
94 log.info("Deleting %d temporary file(s)", len(self.server.tmpfiles))
95 for f in self.server.tmpfiles:
98 def _sighandler(self, _signum, _frame): argument
100 self.shutdown_event.set()
102 def run(self): argument
104 self.shutdown_event.wait()
106 self.server.shutdown()
168 def __init__(self, argument
172 imp_smbserver.SMBSERVER.__init__(self,
175 self.tmpfiles = []
178 self.ctd = TestData(test_data_directory)
182 self.hookSmbCommand(imp_smb.SMB.SMB_COM_NT_CREATE_ANDX,
183 self.create_and_x)
185 def create_and_x(self, conn_id, smb_server, smb_command, recv_packet): argument
199 path = self.get_share_path(conn_data,
231 fid, full_path = self.get_server_path(requested_file)
234 fid, full_path = self.get_test_path(requested_file)
236 self.tmpfiles.append(full_path)
297 def get_share_path(self, conn_data, root_fid, tid): argument
317 def get_server_path(self, requested_filename): argument
337 self.write_to_fid(fid, contents)
340 def write_to_fid(self, fid, contents): argument
348 def get_test_path(self, requested_filename): argument
356 contents = self.ctd.get_test_data(requested_filename).encode('utf-8')
357 self.write_to_fid(fid, contents)
366 def __init__(self, error_code, error_message): argument
367 super(SmbError, self).__init__(error_message)
368 self.error_code = error_code