From 99fc6ff4e983b89681b307c6f39e1d18438e982f Mon Sep 17 00:00:00 2001 From: David Scott Date: Thu, 16 Oct 2014 00:28:13 +0000 Subject: [PATCH 1/4] control: open the Types.Type module This allows access to constructors like 'String' Signed-off-by: David Scott --- generator/src/control.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/generator/src/control.ml b/generator/src/control.ml index 1f8450dd..eb5cfd20 100644 --- a/generator/src/control.ml +++ b/generator/src/control.ml @@ -1,4 +1,5 @@ open Types +open Type let api = let volume_decl = From e9b4be598ba4f5de059c6b5bbf8053c9a439f03a Mon Sep 17 00:00:00 2001 From: David Scott Date: Thu, 16 Oct 2014 00:28:52 +0000 Subject: [PATCH 2/4] HTML generation is optional, off by default Signed-off-by: David Scott --- generator/src/main.ml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/generator/src/main.ml b/generator/src/main.ml index cf5849a3..2318c748 100644 --- a/generator/src/main.ml +++ b/generator/src/main.ml @@ -1,7 +1,13 @@ -open Types -open Files let _ = + let generate_html = ref false in + Arg.parse [ + "-html", Arg.Set generate_html, "Output HTML docs"; + ] (fun x -> Printf.fprintf stderr "Unknown argument: %s\n%!" x; exit 1) + "Generate OCaml/Python/HTML documentation"; + + let open Types in + let open Files in let apis = [ Plugin.api; Control.api; @@ -10,7 +16,8 @@ let _ = (* Prepend the debug_info argument *) let apis = List.map Types.prepend_dbg apis in - Www.write apis; + if !generate_html + then Www.write apis; List.iter (fun api -> From 9afb10ad87d2bc5bf9f74953385306fabe9112b1 Mon Sep 17 00:00:00 2001 From: David Scott Date: Thu, 16 Oct 2014 00:31:00 +0000 Subject: [PATCH 3/4] Makefile: add an 'html' target This is useful now that html is off by default. Signed-off-by: David Scott --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 5509cc5e..cf5e664d 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,10 @@ build: ./generator/main.native make -C ocaml +.PHONY: html +html: build + ./generator/main.native -html + .PHONY: install install: make -C ocaml install From 75b733768928f204fe20777c5ff4014bb13b5a7d Mon Sep 17 00:00:00 2001 From: David Scott Date: Thu, 16 Oct 2014 00:36:58 +0000 Subject: [PATCH 4/4] Makefile: python targets Signed-off-by: David Scott --- .gitignore | 7 +++++-- Makefile | 4 ++++ python/Makefile | 14 ++++++++++++++ python/setup.py | 3 +++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 python/Makefile create mode 100644 python/setup.py diff --git a/.gitignore b/.gitignore index 3d393ea0..9e864e07 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,10 @@ generator/_build generator/main.native ocaml/lib/v.ml ocaml/lib/d.ml -python/V.py -python/D.py +ocaml/lib/p.ml doc ocaml/examples +python/build +python/d.py +python/v.py +python/p.py diff --git a/Makefile b/Makefile index cf5e664d..f2709531 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ build: mkdir -p ocaml/examples ./generator/main.native make -C ocaml + make -C python .PHONY: html html: build @@ -15,12 +16,15 @@ html: build .PHONY: install install: make -C ocaml install + make -C python install .PHONY: reinstall reinstall: make -C ocaml reinstall + make -C python reinstall .PHONY: clean clean: make -C generator clean make -C ocaml clean + make -C python clean diff --git a/python/Makefile b/python/Makefile new file mode 100644 index 00000000..2c643253 --- /dev/null +++ b/python/Makefile @@ -0,0 +1,14 @@ +PREFIX?=/ + +.PHONY: build +build: + python setup.py build + +.PHONY: clean +clean: + python setup.py clean + rm -rf build + +.PHONY: install +install: build + python setup.py install --prefix $(PREFIX) diff --git a/python/setup.py b/python/setup.py new file mode 100644 index 00000000..36a46116 --- /dev/null +++ b/python/setup.py @@ -0,0 +1,3 @@ +from distutils.core import setup +setup (name = "xapi-storage", version = "0.1", + py_modules = ["d", "p", "v", "xapi"])