Skip to content
Snippets Groups Projects

Add title page. Modify conf.py.

Merged Mikhail Karnevskiy requested to merge feat/manual_titlepage into master
3 unresolved threads

@ahmedk @haufs

Default title page for calibration report is substituted by manually written. A config file conf.py tells sphinx to use a manual title page. Corresponding tex file is created by the python function make_titlepage.

In suggest code default config file is modified by make_report with the same way, as it is done for index.rst.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • 3de8576f - Use different approach to edit conf.py file

    Compare with previous version

  • added 34 commits

    Compare with previous version

  • added 1 commit

    • a4e1e525 - Use template. Optimise imports.

    Compare with previous version

  • Author Contributor

    @haufs Suggested changes were introduces. Branch is re-based on master. Could you review it again.

  • Steffen Hauf
  • 5 from shutil import copy, move, rmtree, copytree
    8 6 from queue import Queue
    9 import re
    10 import shutil
    11 from subprocess import Popen, PIPE, check_output, check_call
    7 from collections import OrderedDict
    8 import glob
    9 from jinja2 import Template
    12 10 import textwrap
    13 from time import sleep
    14 import time
    15 from uuid import uuid4
    16
    11 import tabulate
    12 from importlib.machinery import SourceFileLoader
    13 from xfel_calibrate import settings
  • 208 with open("{}/conf.py.tmp".format(run_path), "w") as mf:
    209 latex_elements = {'extraclassoptions': ',openany, oneside',
    210 'maketitle': r'\input{titlepage.tex.txt}'}
    211 mf.write("latex_elements = {}\n".format(latex_elements))
    212 mf.write("latex_logo = '{}/{}'\n".format(module_path,
    213 settings.logo_path))
    214 mf.write("latex_additional_files = ['titlepage.tex.txt']\n")
    215
    216 for var in l_var:
    217 if var in ['latex_elements', 'latex_logo',
    218 'latex_additional_files']:
    219 continue
    220 tmpl = '{} = {}\n'
    221 v = getattr(conf, var, None)
    222 if isinstance(v, str):
    223 print(var, v)
  • 234 254 os.chdir(run_path)
    235 255 try:
    236 import subprocess
    237 subprocess.check_call(["make", "latexpdf"])
    256 check_call(["make", "latexpdf"])
    238 257
    239 except subprocess.CalledProcessError:
    258 except CalledProcessError:
    240 259 print("Failed to make pdf documentation")
    241 print("Temp files will not be deleted and "+
    260 print("Temp files will not be deleted and " +
    242 261 "can be inspected at: {}".format(run_path))
    243 262 return
    244 263 print("Moving report to final location: {}".format(out_path))
    245 264 for f in glob.glob(r'{}/_build/latex/*.pdf'.format(run_path)):
    246 265 print(f)
  • A few minor comments, other than that LGTM

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • mentioned in commit aa52736a

  • Please register or sign in to reply
    Loading