Commit cd446da6 authored by Saeed SARFJOO's avatar Saeed SARFJOO Committed by Amir MOHAMMADI

Handling the --help command in download_and_untar script

parent 7f85f152
Pipeline #19398 passed with stage
in 58 minutes and 26 seconds
......@@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
def main():
import pkg_resources
......@@ -25,9 +27,14 @@ def main():
else:
import urllib.request as urllib
import tarfile
import argparse
parser = argparse.ArgumentParser(description='Download and extract the Voxforge database.')
parser.add_argument("--address", default="VOXFORGE_DATABASE", help="Where downloaded archives will be placed. Default is 'VOXFORGE_DATABASE' folder.")
args = parser.parse_args()
directory = sys.argv[1] if len(sys.argv) > 1 else "VOXFORGE_DATABASE"
directory = args.address
if not os.path.exists(directory):
print ("Creating intermediate directory '%s', where downloaded archives will be placed" % directory)
os.makedirs(directory)
......@@ -66,3 +73,4 @@ def main():
finally:
# TODO: should we leave possibly broken files here, so that it can be inspected later?
os.remove(tempfile)
......@@ -59,7 +59,7 @@ The original data can be downloaded directly from Voxforge_, or by running ``dow
.. code-block:: sh
$ download_and_untar_voxforge.py PATH/TO/WAV/DIRECTORY
$ download_and_untar_voxforge.py --address PATH/TO/WAV/DIRECTORY
.. note::
Running this script requires this package to be installed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment