def write(self, fd, msg_fd=None):
<INDENT>if msg_fd != None:<EOL><INDENT>print >>fd, self.messagesImports<EOL>print >>msg_fd, self.imports<EOL><DEDENT>else:<EOL><DEDENT>print(self.imports, file=fd)<EOL>print(self.locator, file=fd)<EOL>for m in self.bindings:<EOL><INDENT>print(m, file=fd)<EOL>
write out module to file descriptor.
        fd -- file descriptor to write out service description.
        msg_fd -- optional file descriptor for messages module.