From bb1e67a83c34eed3ebe57ccaef7a415c85beac3a Mon Sep 17 00:00:00 2001
From: Rudi Grinberg <rudi.grinberg@sourcefabric.org>
Date: Tue, 21 Aug 2012 10:46:48 -0400
Subject: [PATCH] small refactoring of to os.path.join instead of manual path
 concatenation.

---
 python_apps/pypo/recorder.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/python_apps/pypo/recorder.py b/python_apps/pypo/recorder.py
index 00d51c010..de48afd1c 100644
--- a/python_apps/pypo/recorder.py
+++ b/python_apps/pypo/recorder.py
@@ -73,16 +73,18 @@ class ShowRecorder(Thread):
         else:
             filetype = "ogg";
 
-        filepath = "%s%s.%s" % (config["base_recorded_files"], filename, filetype)
+        joined_path = os.path.join(config["base_recorded_files"], filename)
+        filepath = "%s.%s" % (joined_path, filetype)
 
         br = config["record_bitrate"]
         sr = config["record_samplerate"]
-        c = config["record_channels"]
+        c  = config["record_channels"]
         ss = config["record_sample_size"]
 
         #-f:16,2,44100
         #-b:256
-        command = "ecasound -f:%s,%s,%s -i alsa -o %s,%s000 -t:%s" % (ss, c, sr, filepath, br, length)
+        command = "ecasound -f:%s,%s,%s -i alsa -o %s,%s000 -t:%s" % \
+                                (ss, c, sr, filepath, br, length)
         args = command.split(" ")
 
         self.logger.info("starting record")