Bug 1441019 - Remove "./mach marionette doc" command. r=whimboo

This removes the "./mach marionette doc" command in favour of the
Sphinx-powered "./mach doc".

MozReview-Commit-ID: IODqDR4O1Dr

--HG--
extra : rebase_source : cfee834e6d10e59f34fc7d599facdb2eb6f4d363
This commit is contained in:
Andreas Tolfsen 2018-02-26 11:48:48 +00:00
parent 861f417ede
commit 18b1a11e85

View File

@ -119,41 +119,3 @@ class Marionette(MachCommandBase):
if not kwargs.get("binary") and conditions.is_firefox(self):
kwargs["binary"] = self.get_binary_path("app")
return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
@SubCommand("marionette", "doc",
description="Generate Marionette server API documentation in testing/marionette/doc.")
@CommandArgument("--http",
help='HTTP service address (e.g. "127.0.0.1:6060" or just ":6060".'
)
def marionette_doc(self, http, **kwargs):
import subprocess
def is_marionette_source_file(filename):
path = os.path.join(self.srcdir, filename)
return (os.path.isfile(path)
and filename.endswith(".js")
and not filename.startswith("test_"))
srcs = [f for f in os.listdir(
self.srcdir) if is_marionette_source_file(f)]
proc = subprocess.Popen(
["jsdoc", "-c", ".jsdoc.js"] + srcs, cwd=self.srcdir)
proc.wait()
if http and proc.returncode == 0:
import SimpleHTTPServer
import SocketServer
host, port = http.split(":")
host = host or "127.0.0.1"
port = int(port)
handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer((host, int(port)), handler)
print("serving at %s:%s" % (host, port))
os.chdir(os.path.join(self.srcdir, "doc"))
httpd.serve_forever()
return proc.returncode