""" """This command-line program downloads a document from a MobWrite server. The MobWrite URL and the docname are provided on the command line. The document content is printed to standard output. Version numbers are not tracked. """ __author__ = "[email protected] (Neil Fraser)" import mobwritelib import sys if __name__ == "__main__": # Obtain the server URL and the docname from the command line argument. if len(sys.argv) != 3: print >> sys.stderr, "Usage: %s <URL> <DOCNAME>" % sys.argv[0] print >> sys.stderr, " E.g. %s http://mobwrite3.appspot.com/scripts/q.py demo_editor_text" % sys.argv[ 0] print >> sys.stderr, " E.g. %s telnet://localhost:3017 demo_editor_text" % sys.argv[ 0] sys.exit(2) url = sys.argv[1] docname = sys.argv[2] results = mobwritelib.download(url, [docname]) if docname in results: if results.get(docname): print results.get(docname), else: sys.exit("Error: MobWrite server failed to provide data.")
limitations under the License. """ """This command-line program downloads a document from a MobWrite server. The MobWrite URL and the docname are provided on the command line. The document content is printed to standard output. Version numbers are not tracked. """ __author__ = "[email protected] (Neil Fraser)" import mobwritelib import sys if __name__ == "__main__": # Obtain the server URL and the docname from the command line argument. if len(sys.argv) != 3: print >> sys.stderr, "Usage: %s <URL> <DOCNAME>" % sys.argv[0] print >> sys.stderr, " E.g. %s http://mobwrite3.appspot.com/scripts/q.py demo_editor_text" % sys.argv[0] print >> sys.stderr, " E.g. %s telnet://localhost:3017 demo_editor_text" % sys.argv[0] sys.exit(2) url = sys.argv[1] docname = sys.argv[2] results = mobwritelib.download(url, [docname]) if docname in results: if results.get(docname): print results.get(docname), else: sys.exit("Error: MobWrite server failed to provide data.")
def raw_text(self): """Raw text as retrieved by the server.""" return mobwritelib.download(self.syncServerGateway,[self.mobID])[self.mobID]