Skip to content

Commit

Permalink
Improve documentation of file and folder dialog handler
Browse files Browse the repository at this point in the history
  • Loading branch information
thatsIch committed Feb 2, 2017
1 parent 31baedf commit a46e534
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions path/prompt_dialog.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""This module is handling native calls to user file and folder selection."""

import os.path
import subprocess
Expand All @@ -8,10 +9,6 @@
from .. import logger


def sink(message):
logger.info(message)


def popen_and_call(callback, *popen_args, **popen_kwargs):
"""
Runs a subprocess.Popen, and then calls the function onExit when the
Expand All @@ -22,6 +19,11 @@ def popen_and_call(callback, *popen_args, **popen_kwargs):
*popenArgs and **popenKWArgs are simply passed up to subprocess.Popen.
"""
def run_in_thread(callback, popen_args, popen_kwargs):
"""
This is a wrapped method call with a direct callback upon finishing the process.
You use this because the user input will halt the processing if not started in a new thread.
"""
proc = subprocess.Popen(*popen_args, **popen_kwargs)
output_channel, error_channel = proc.communicate()
message = output_channel.decode("utf-8")
Expand Down

0 comments on commit a46e534

Please sign in to comment.