Skip to content

Commit

Permalink
Added support for paths that contains spaces - fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
mwydmuch committed May 13, 2018
1 parent 2cf4975 commit 4c0b8fb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pyoblige/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "0.1.1"
__version__ = "0.1.3"
from .oblige import *
from .wad_configs import *
19 changes: 9 additions & 10 deletions pyoblige/oblige.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

from __future__ import print_function
import os
import sys
Expand Down Expand Up @@ -339,11 +337,11 @@ def generate(self, wad_path, verbose=False):
raise Exception("Oblige does not exists! Package is incomplete!")

if verbose:
print("Config text file path: {}"
"\nOutput wad file path: {}"
"\nOblige executable path: {}".format(config_path, wad_path, oblige_path))
print('Config text file path: "{}"'
'\nOutput wad file path: "{}"'
'\nOblige executable path: "{}"'.format(config_path, wad_path, oblige_path))

cmd = "{} --batch {} --load {} --keep".format(oblige_exe, wad_path, config_path)
cmd = '"{}" --batch "{}" --load "{}" --keep'.format(oblige_exe, wad_path, config_path)
if verbose:
cmd += " --verbose"

Expand All @@ -355,12 +353,13 @@ def generate(self, wad_path, verbose=False):
exit_code = oblige_process.returncode

except subprocess.CalledProcessError:
raise Exception("Oblige failed to generate .wad file!\nExit code: {}\nLog:\n{}"
.format(exit_code, results))
raise Exception("Oblige failed to generate .wad file!"
"\nExit code: {}"
"\nLog:\n{}".format(exit_code, results))

if verbose:
print("Exit code: {}\n"
"Oblige output:\n{}".format(exit_code, results))
print("Exit code: {}"
"\nOblige output:\n{}".format(exit_code, results))

# Parse results
maps = 1
Expand Down
1 change: 0 additions & 1 deletion pyoblige/wad_configs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

test_wad = {
"theme": "bit_mixed",
"size": "micro",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def run(self):

setup(
name='oblige',
version='0.1.2',
version='0.1.3',
description='Level generator for DOOM',
long_description="Level generator for DOOM. Wrapper for Oblige.",
url='https://github.com/mwydmuch/PyOblige',
Expand Down

0 comments on commit 4c0b8fb

Please sign in to comment.