Skip to content

Commit

Permalink
I keep forgetting that I shouldn't use the root logger :p
Browse files Browse the repository at this point in the history
  • Loading branch information
10se1ucgo committed Mar 13, 2016
1 parent edd29ed commit c027596
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ As of 2/21/16, it works!
* [watchdog](https://pypi.python.org/pypi/watchdog) - Cross-platform file system monitoring
* [youtube-dl](https://github.com/rg3/youtube-dl/) - Audio/Video downloader (supports many websites, not just YouTube)
* [psutil](https://github.com/giampaolo/psutil) - Process/system utilities (Used for detecting Steam path)
* [requests](http://docs.python-requests.org/en/master/)
* [requests](http://docs.python-requests.org/en/master/) - HTTP library used for downloading FFmpeg
* [unidecode](https://pypi.python.org/pypi/Unidecode) - Filter out pesky unicode characters that cause problems :(

## Python <3.3
* [shutilwhich](https://pypi.python.org/pypi/shutilwhich) - Backport of shutil.which()
Expand Down
5 changes: 3 additions & 2 deletions ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ def run(self):
try:
logger.info(convert_audio(track, file, self.rate, self.vol))
except subprocess.CalledProcessError as e:
logging.exception("FFmpeg converter: Couldn't convert {track}".format(track=track))
logging.critical("FFmpeg converter: Error output log\n" + e.output.decode('ascii', 'replace'))
print(e)
logger.exception("FFmpeg converter: Couldn't convert {track}".format(track=track))
logger.critical("FFmpeg converter: Error output log\n" + e.output.decode('ascii', 'replace'))
errors.append(track)
# File's headers aren't stripped, which normally would increase self.converted by 1.
self.converted += 1
Expand Down
4 changes: 3 additions & 1 deletion jam_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from string import whitespace, punctuation

import psutil
import unidecode
import wx # Tested w/ wxPhoenix 3.0.2
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
Expand Down Expand Up @@ -390,6 +391,7 @@ def get_tracks(audio_path):
for track in glob.glob(os.path.join(audio_path, '*.wav')):
bind = None
name = os.path.splitext(os.path.basename(track))[0] # Name of file minus path/extension
name = unidecode.unidecode(name)
if name in track_data and ('aliases' in track_data[name] or 'bind' in track_data[name]):
custom_aliases = track_data[name].get('aliases')
custom_bind = track_data[name].get('bind')
Expand Down Expand Up @@ -419,7 +421,7 @@ def filter_aliases(alias_or_name):
filtered_name += char.lower()
elif char in punctuation and not "'":
filtered_name += ' '
return filtered_name.encode('ascii', 'ignore')
return filtered_name


def get_steam_path():
Expand Down

0 comments on commit c027596

Please sign in to comment.