shhuang1/chipsequtil — pull request #1 by iamatypeofwalrus (2013-05-10 19:03:02+00:00)
Title: Fix Tab Completer

I encountered a bug where the tab completer would leave a trailing space when there was only on possible completion option. If the user entered the file name with that trailing space the script would throw an error when it eventually tried to open that file due to the fact that any spaces are globally replace with "_".

e.g.
Traceback (most recent call last):
File "/mnt/thumper-e1/home/shhuang/devel/chipsequtil/scripts/create_alignment_script.py", line 310, in
samp_ifh = open(samp_fn,'r')
IOError: [Errno 2] No such file or directory: 'mingtang_liang_new_samples.csv_'

I could have fixed just that line to check for trailing spaces before replacing any spaces with "_" globally but it seemed better to just fix the tab completer.

Now the tab completer will not leave trailing spaces when paths or files are completed.