Skip to content

Commit

Permalink
Temporary make Grass7Utils more verbose for more travis debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Médéric Ribreux authored and Médéric RIBREUX committed May 29, 2016
1 parent 8884cd7 commit 1945fac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions python/plugins/processing/algs/grass7/Grass7Utils.py
Expand Up @@ -261,6 +261,7 @@ def executeGrass7(commands, progress, outputCommands=None):
loglines.append(Grass7Utils.tr('GRASS GIS 7 execution console output'))
grassOutDone = False
command, grassenv = Grass7Utils.prepareGrass7Execution(commands)
print('Debug: executeGrass7\n---------------\ncommands: {}\n\ncommand: {}\n\nenv: {}'.format(commands, command, grassenv))
proc = subprocess.Popen(
command,
shell=True,
Expand All @@ -271,6 +272,7 @@ def executeGrass7(commands, progress, outputCommands=None):
env=grassenv
).stdout
for line in iter(proc.readline, ''):
print(line)
if 'GRASS_INFO_PERCENT' in line:
try:
progress.setPercentage(int(line[len('GRASS_INFO_PERCENT') + 2:]))
Expand All @@ -290,6 +292,8 @@ def executeGrass7(commands, progress, outputCommands=None):

if not grassOutDone and outputCommands:
command, grassenv = Grass7Utils.prepareGrass7Execution(outputCommands)
print('Debug: executeGrass7 outputCommands\n=============\ncommands: {}\n\ncommand: {}\n\nenv: {}'.format(commands, command, grassenv))

proc = subprocess.Popen(
command,
shell=True,
Expand All @@ -300,6 +304,7 @@ def executeGrass7(commands, progress, outputCommands=None):
env=grassenv
).stdout
for line in iter(proc.readline, ''):
print(line)
if 'GRASS_INFO_PERCENT' in line:
try:
progress.setPercentage(int(
Expand Down
7 changes: 3 additions & 4 deletions python/plugins/processing/tests/AlgorithmsTestBase.py
Expand Up @@ -83,8 +83,7 @@ def check_algorithm(self, name, defs):
:param defs: A python dict containing a test algorithm definition
"""
QgsMapLayerRegistry.instance().removeAllMapLayers()
print('DEBUG on {}'.format(name))
print('Params = {}'.format(defs))

params = self.load_params(defs['params'])
alg = processing.Processing.getAlgorithm(defs['algorithm']).getCopy()

Expand Down Expand Up @@ -185,14 +184,14 @@ def filepath_from_param(self, param):
prefix = processingTestDataPath()
if 'location' in param and param['location'] == 'qgs':
prefix = unitTestDataPath()
print('DEBUG filepath_from_param: {} -> {}'.format(param['name'], os.path.join(prefix, param['name'])))

return os.path.join(prefix, param['name'])

def check_results(self, results, expected):
"""
Checks if result produced by an algorithm matches with the expected specification.
"""
print('DEBUG check_results: results {}\n\texpected {}'.format(results, expected))

for id, expected_result in expected.items():
if 'vector' == expected_result['type']:
expected_lyr = self.load_layer(expected_result)
Expand Down

0 comments on commit 1945fac

Please sign in to comment.