Dump decisions to yaml

This commit is contained in:
Felix Wittwer 2019-07-08 17:21:23 +02:00
parent ef7aa24262
commit 91f0c8e4f4
Signed by untrusted user who does not match committer: wittwer
GPG key ID: 24363525EA0E8A99
3 changed files with 314 additions and 11 deletions

278
.gitignore vendored Normal file
View file

@ -0,0 +1,278 @@
protokoll/*.yaml
protokoll/protokoll.pdf
# Created by https://www.gitignore.io/api/latex
# Edit at https://www.gitignore.io/?templates=latex
### LaTeX ###
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb
## Intermediate documents:
*.dvi
*.xdv
*-converted-to.*
# these rules might exclude image files for figures etc.
# *.ps
# *.eps
# *.pdf
## Generated if empty string is given at "Please type another file name for output:"
.pdf
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
## Build tool auxiliary files:
*.fdb_latexmk
*.synctex
*.synctex(busy)
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
## Build tool directories for auxiliary files
# latexrun
latex.out/
## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
*.loa
# achemso
acs-*.bib
# amsthm
*.thm
# beamer
*.nav
*.pre
*.snm
*.vrb
# changes
*.soc
# comment
*.cut
# cprotect
*.cpt
# elsarticle (documentclass of Elsevier journals)
*.spl
# endnotes
*.ent
# fixme
*.lox
# feynmf/feynmp
*.mf
*.mp
*.t[1-9]
*.t[1-9][0-9]
*.tfm
#(r)(e)ledmac/(r)(e)ledpar
*.end
*.?end
*.[1-9]
*.[1-9][0-9]
*.[1-9][0-9][0-9]
*.[1-9]R
*.[1-9][0-9]R
*.[1-9][0-9][0-9]R
*.eledsec[1-9]
*.eledsec[1-9]R
*.eledsec[1-9][0-9]
*.eledsec[1-9][0-9]R
*.eledsec[1-9][0-9][0-9]
*.eledsec[1-9][0-9][0-9]R
# glossaries
*.acn
*.acr
*.glg
*.glo
*.gls
*.glsdefs
# uncomment this for glossaries-extra (will ignore makeindex's style files!)
# *.ist
# gnuplottex
*-gnuplottex-*
# gregoriotex
*.gaux
*.gtex
# htlatex
*.4ct
*.4tc
*.idv
*.lg
*.trc
*.xref
# hyperref
*.brf
# knitr
*-concordance.tex
# TODO Comment the next line if you want to keep your tikz graphics files
*.tikz
*-tikzDictionary
# listings
*.lol
# luatexja-ruby
*.ltjruby
# makeidx
*.idx
*.ilg
*.ind
# minitoc
*.maf
*.mlf
*.mlt
*.mtc[0-9]*
*.slf[0-9]*
*.slt[0-9]*
*.stc[0-9]*
# minted
_minted*
*.pyg
# morewrites
*.mw
# nomencl
*.nlg
*.nlo
*.nls
# pax
*.pax
# pdfpcnotes
*.pdfpc
# sagetex
*.sagetex.sage
*.sagetex.py
*.sagetex.scmd
# scrwfile
*.wrt
# sympy
*.sout
*.sympy
sympy-plots-for-*.tex/
# pdfcomment
*.upa
*.upb
# pythontex
*.pytxcode
pythontex-files-*/
# tcolorbox
*.listing
# thmtools
*.loe
# TikZ & PGF
*.dpth
*.md5
*.auxlock
# todonotes
*.tdo
# vhistory
*.hst
*.ver
# easy-todo
*.lod
# xcolor
*.xcp
# xmpincl
*.xmpi
# xindy
*.xdy
# xypic precompiled matrices
*.xyc
# endfloat
*.ttt
*.fff
# Latexian
TSWLatexianTemp*
## Editors:
# WinEdt
*.bak
*.sav
# Texpad
.texpadtmp
# LyX
*.lyx~
# Kile
*.backup
# KBibTeX
*~[0-9]*
# auto folder when using emacs and auctex
./auto/*
*.el
# expex forward references with \gathertags
*-tags.tex
# standalone packages
*.sta
### LaTeX Patch ###
# glossaries
*.glstex
# End of https://www.gitignore.io/api/latex

View file

@ -125,35 +125,60 @@
\newsavebox{\mybox} \newsavebox{\mybox}
\newcounter{x} % counter to add up two arguments \newcounter{x} % counter to add up two arguments
\newenvironment{vote} {% \newenvironment{vote} {%
\immediate\write\exportdata{-}
\begin{lrbox}{\mybox}\begin{minipage}{.985\textwidth} \begin{lrbox}{\mybox}\begin{minipage}{.985\textwidth}
\newcommand*{\voteNumber}[1]{% \newcommand*{\voteNumber}[1]{%
\immediate\write\exportdata{\the\year/##1}% \immediate\write\exportdata{ decision_id: "\the\year/##1"}%
\textbf{\the\year\,/\,##1:}\\% \textbf{\the\year\,/\,##1:}\\%
}% }%
\newcommand*{\voteMoney}[1]{% \newcommand*{\voteMoney}[1]{%
\ifthenelse{\equal{##1}{}} {\textbf{Antrag}} {\textbf{Finanzantrag}}% \ifthenelse{\equal{##1}{}} {%
\immediate\write\exportdata{ money_limit: NULL}%
\textbf{Antrag}%
} {%
\immediate\write\exportdata{ money_limit: ##1}%
\textbf{Finanzantrag}%
}%
} }
\newcommand*{\voteText}[1]{##1\vspace{\baselineskip}\\}% \newcommand*{\voteText}[1]{%
\newcommand*{\voteReason}[1]{\textbf{Begründung: }##1\vspace{\baselineskip}\\}% \immediate\write\exportdata{ text: "##1"}%
##1\vspace{\baselineskip}\\}%
\newcommand*{\voteReason}[1]{%
\immediate\write\exportdata{ rationale: "##1"}%
\textbf{Begründung: }##1\vspace{\baselineskip}\\}%
\newcommand*{\voting}[3]{\textbf{Abstimmung: }% \newcommand*{\voting}[3]{\textbf{Abstimmung: }%
\ifthenelse{\equal{##1}{} \AND \equal{##2}{} \AND \equal{##3}{}} {% \ifthenelse{\equal{##1}{} \AND \equal{##2}{} \AND \equal{##3}{}} {%
\immediate\write\exportdata{ v_yes: 0}%
\immediate\write\exportdata{ v_no: 0}%
\immediate\write\exportdata{ v_neutral: 0}%
\immediate\write\exportdata{ accepted: 1}%
Der Antrag wurde ohne Gegenrede angenommen.% Der Antrag wurde ohne Gegenrede angenommen.%
} {% } {%
\immediate\write\exportdata{ v_yes: ##1}%
\immediate\write\exportdata{ v_no: ##2}%
\immediate\write\exportdata{ v_neutral: ##3}%
Dafür: ##1, Dagegen: ##2, Enthaltungen: ##3% Dafür: ##1, Dagegen: ##2, Enthaltungen: ##3%
\\% \\%
\setcounter{x}{##2+##3}% \setcounter{x}{##2+##3}%
\ifnum##1>\arabic{x}% \ifnum##1>\arabic{x}%
{Der Antrag wurde angenommen.}% {%
\immediate\write\exportdata{ accepted: 1}%
Der Antrag wurde angenommen.
}%
\else% \else%
{Der Antrag wurde abgelehnt.}% {
\immediate\write\exportdata{ accepted: 0}%
Der Antrag wurde abgelehnt.
}%
\fi% \fi%
}% }%
}% }%
\newcommand*{\voteComment}[1]{##1}% \newcommand*{\voteComment}[1]{%
\immediate\write\exportdata{ comment: "##1"}%
##1
}%
} { } {
\end{minipage}\end{lrbox}\fbox{\usebox{\mybox}} \end{minipage}\end{lrbox}\fbox{\usebox{\mybox}}
\immediate\write\exportdata{
}%
} }
% poll environment % poll environment
@ -195,7 +220,7 @@
} }
\AtEndDocument{% \AtEndDocument{%
\immediate\write18{mv tmp.txt \the\date.txt} \immediate\write18{mv tmp.txt \the\date.yaml}
\immediate\closeout\exportdata% \immediate\closeout\exportdata%
} }

View file

@ -57,7 +57,7 @@
% % Die Reihenfolge muss beibehalten werden. % % Die Reihenfolge muss beibehalten werden.
% \begin{vote} % \begin{vote}
% % \voteMoney{} % {Betrag (ohne \EUR)} nur bei Finanzantrag % \voteMoney{} % {Betrag (ohne \EUR)} nur bei Finanzantrag, sonst leer lassen
% \voteNumber{} % {#Antrag} % \voteNumber{} % {#Antrag}
% \voteText{} % \voteText{}
% \voteReason{} % \voteReason{}