[glib/glib-2-52] gdbus-codegen: Apply --output-directory to generated docs as well
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-52] gdbus-codegen: Apply --output-directory to generated docs as well
- Date: Thu, 22 Jun 2017 15:39:56 +0000 (UTC)
commit 2026cb7498cb1687e2458a622d17169240914247
Author: Florian Müllner <fmuellner gnome org>
Date: Mon May 29 00:38:19 2017 +0200
gdbus-codegen: Apply --output-directory to generated docs as well
In addition to code, gdbus-codegen can also generate docbook
documentation for DBus interfaces. There's no good reason why
the newly added --output-directory option shouldn't apply to
those generated files as well.
https://bugzilla.gnome.org/show_bug.cgi?id=783201
gio/gdbus-2.0/codegen/codegen_docbook.py | 6 ++++--
gio/gdbus-2.0/codegen/codegen_main.py | 5 +++--
2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gio/gdbus-2.0/codegen/codegen_docbook.py b/gio/gdbus-2.0/codegen/codegen_docbook.py
index 18e3d00..5f50f55 100644
--- a/gio/gdbus-2.0/codegen/codegen_docbook.py
+++ b/gio/gdbus-2.0/codegen/codegen_docbook.py
@@ -21,6 +21,7 @@
import sys
import re
+from os import path
from . import config
from . import utils
@@ -30,9 +31,10 @@ from . import parser
# ----------------------------------------------------------------------------------------------------
class DocbookCodeGenerator:
- def __init__(self, ifaces, docbook):
+ def __init__(self, ifaces, docbook, outdir):
self.ifaces = ifaces
self.docbook = docbook
+ self.outdir = outdir
self.generate_expand_dicts()
def print_method_prototype(self, i, m, in_synopsis):
@@ -270,7 +272,7 @@ class DocbookCodeGenerator:
def generate(self):
for i in self.ifaces:
- self.out = open('%s-%s.xml'%(self.docbook, i.name), 'w')
+ self.out = open(path.join(self.outdir, '%s-%s.xml'%(self.docbook, i.name)), 'w')
self.out.write(''%())
self.out.write('<?xml version="1.0" encoding="utf-8"?>\n'%())
self.out.write('<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"\n'%())
diff --git a/gio/gdbus-2.0/codegen/codegen_main.py b/gio/gdbus-2.0/codegen/codegen_main.py
index 5725400..49de9c0 100755
--- a/gio/gdbus-2.0/codegen/codegen_main.py
+++ b/gio/gdbus-2.0/codegen/codegen_main.py
@@ -181,14 +181,15 @@ def codegen_main():
for i in all_ifaces:
i.post_process(opts.interface_prefix, opts.c_namespace)
+ outdir = opts.output_directory
+
docbook = opts.generate_docbook
- docbook_gen = codegen_docbook.DocbookCodeGenerator(all_ifaces, docbook);
+ docbook_gen = codegen_docbook.DocbookCodeGenerator(all_ifaces, docbook, outdir);
if docbook:
ret = docbook_gen.generate()
c_code = opts.generate_c_code
if c_code:
- outdir = opts.output_directory
header_name = c_code + '.h'
h = open(path.join(outdir, header_name), 'w')
c = open(path.join(outdir, c_code + '.c'), 'w')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]