#!/cygdrive/c/python32/python
# Program to make sure birds with partial descriptions
# (directory text) and also have full descriptions
# (directory Descriptions) are moved to 'Old' directory
# in the text directory.
import pdb
import os
import subprocess

# First get a list of the files in the Description directory
os.chdir('../Descriptions')
ls_in = str(subprocess.check_output(['ls', '*.txt']), encoding='utf8')
pdb.set_trace()
ls_in = ls_in.rstrip('\n')
alist = ls_in.split('\n')
os.chdir('../text')
for name in alist:
    if os.path.isfile(name):
        pdb.set_trace()
        new = 'Old/' + name
        print ('Moving ' + name + ' to ' + new)
        os.rename(name, new)
