Skip to content

Commit

Permalink
Fix autosize issue on Win 10 and bump version number
Browse files Browse the repository at this point in the history
The autosize option would not work on Win10. Reused the code for calling
dot and it now works again. Not tested extensively.
  • Loading branch information
kjellmf committed Mar 16, 2019
1 parent 8d113a3 commit 9c6d1c3
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 14 deletions.
5 changes: 3 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ dot2tex change log

Here you can see the full list of changes between each dot2tex release.

2.11.dev
--------
2.11.2
------

- Added support for the circle node shape. Thanks to Alexander Hagen for the pull request.
- Fix Popen issue on windows 10 when calling latex. The --autosize option is now working again.

2.11.1
------
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
version = '2.11.1'
version = '2.11.2'
# The full version, including alpha/beta/rc tags.
release = '2.11.1'
release = '2.11.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dot2tex - A Graphviz to LaTeX converter
=======================================

:Author: Kjell Magne Fauske
:Version: 2.11.1
:Version: 2.11.2
:Licence: MIT_


Expand Down
24 changes: 18 additions & 6 deletions dot2tex/dot2tex.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# IN THE SOFTWARE.

__author__ = 'Kjell Magne Fauske'
__version__ = '2.11.1'
__version__ = '2.11.2'
__license__ = 'MIT'

import argparse
Expand Down Expand Up @@ -2650,12 +2650,24 @@ def parse_log_file(self):
else:
command = 'latex -interaction=nonstopmode %s' % self.tempfilename
log.debug('Running command: %s' % command)
proc = Popen(command, shell=True, stdout=PIPE)
proc.wait() # Is this necessary?
sres = proc.stdout

errcode = sres.close()
log.debug('errcode: %s' % errcode)
p = Popen(command, shell=True, stdout=PIPE, stderr=PIPE, close_fds=(sys.platform != 'win32'))
(stdout, stderr) = (p.stdout, p.stderr)
try:
data = stdout.read()
log.debug("stdout from latex\n %s", data)
finally:
stdout.close()

try:
error_data = stderr.read()
if error_data:
log.debug('latex STDERR %s', error_data)
finally:
stderr.close()
p.kill()
p.wait()

with open(logfilename, 'r') as f:
logdata = f.read()
log.debug('Logfile from LaTeX run: \n' + logdata)
Expand Down
2 changes: 1 addition & 1 deletion dot2tex/dotparsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Ero Carrera <ero AT dkbza.org>
"""

__version__ = '2.11.1'
__version__ = '2.11.2'
__author__ = ['Michael Krause', 'Ero Carrera', 'Kjell Magne Fauske']
__license__ = 'MIT'

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Copyright (C) 2006-2019 Kjell Magne Fauske

License: MIT (See LICENSE for details.)

Version: 2.11.1
Version: 2.11.2

URL: https://github.com/kjellmf/dot2tex

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from distutils.core import setup

setup(name='dot2tex',
version='2.11.1',
version='2.11.2',
description='A Graphviz to LaTeX converter',
long_description="""\
The purpose of dot2tex is to give graphs generated by the graph layout tool
Expand Down

0 comments on commit 9c6d1c3

Please sign in to comment.