Skip to content
This repository was archived by the owner on Jun 3, 2019. It is now read-only.

Commit 0d57352

Browse files
committed
Removed rename
1 parent 3515bb4 commit 0d57352

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cleansio/audio/convert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ def __create_converted_file(file_path, encoding):
1717
.set_channels(1) \
1818
.set_sample_width(2) \
1919
.set_frame_rate(__sample_rate(audio_segment)) \
20-
.export(os.environ['CLEANSIO_CONVERSION'], format=encoding)
20+
.export(os.environ['CLEANSIO_TEMP_FILE'], format=encoding)
2121

2222
def convert(file_path, encoding='wav'):
2323
""" Converts an audio file's encoding, returns the file path """
2424
milliseconds = int(round(time.time() * 1000))
2525
temp_dir = create_temp_dir()
26-
os.environ['CLEANSIO_CONVERSION'] = temp_dir + \
26+
os.environ['CLEANSIO_TEMP_FILE'] = temp_dir + \
2727
str(milliseconds) + '.' + encoding
2828
__create_converted_file(file_path, encoding)
29-
return os.environ['CLEANSIO_CONVERSION']
29+
return os.environ['CLEANSIO_TEMP_FILE']

cleansio/utils/cleanup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def setup_cleanup():
2626
def remove_conversions():
2727
""" Removes converted WAV file """
2828

29-
if 'CLEANSIO_CONVERSION' in environ:
30-
temp_file = environ.get('CLEANSIO_CONVERSION')
29+
if 'CLEANSIO_TEMP_FILE' in environ:
30+
temp_file = environ.get('CLEANSIO_TEMP_FILE')
3131
try:
3232
remove(temp_file)
3333
except FileNotFoundError:

tests/utils/test_cleanup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ def test_cleanup():
1414
## Temporary file ##
1515

1616
# Temp file shouldn't exist
17-
if 'CLEANSIO_CONVERSION' in os.environ: # Temp file var exists
17+
if 'CLEANSIO_TEMP_FILE' in os.environ: # Temp file var exists
1818
# Fetch the name of the temp file
19-
temp_file = os.environ.get('CLEANSIO_CONVERSION')
19+
temp_file = os.environ.get('CLEANSIO_TEMP_FILE')
2020
else: # Temp file variable doesn't exist
2121
temp_file_name = str(uuid4().hex) # Fetch a random temporary file name
2222
# Create a path to the temporary file
2323
temp_file = "./{0}".format(temp_file_name)
24-
os.environ['CLEANSIO_CONVERSION'] = temp_file # For function
24+
os.environ['CLEANSIO_TEMP_FILE'] = temp_file # For function
2525

2626
create_temp_file(temp_file)
2727

0 commit comments

Comments
 (0)