def _init_commands(self, protocol): """ Execute any initial commands specified. :param protocol: A Protocol instance (e.g. action) to which to write the commands. """ if not self.initialized: log.msg('Not initialized, sending init commands', debug=True) for next_init in self.init_commands: log.msg('Sending: %r' % next_init, debug=True) protocol.write(next_init + '\r\n') else: self.initialized = True
def writer(protocol, fileInfo): protocol.write("%s\r\n" % fileInfo[6])
def writer(protocol, fileInfo): stat, thing, user, group, size, date, name = fileInfo format = "%s 4 %8s %8s %8d Nov 18 22:00 %s\r\n" protocol.write(format % (modeToString(stat), user, group, size, name))