Skip to content

Instantly share code, notes, and snippets.

@migonzalvar
Created March 7, 2012 21:03
Show Gist options
  • Save migonzalvar/1996236 to your computer and use it in GitHub Desktop.
Save migonzalvar/1996236 to your computer and use it in GitHub Desktop.
cvsanaly helper
#!/usr/bin/env python
import subprocess
import sys
# To create the database:
#
# $ mysqladmin -u root create cvsanaly_android
# > CREATE USER 'cvsanaly'@'localhost' IDENTIFIED BY 'cvsanaly';
# > GRANT ALL ON cvsanaly_android.* TO 'cvsanaly'@'localhost';
if __name__ == '__main__':
try:
folders = sys.argv[1:]
except IndexError:
print sys.argv[0], " folder"
sys.exit()
for folder in folders:
print "Importting ", folder
my_command = (
"cvsanaly2 "
"--db-driver mysql "
"--db-user cvsanaly "
"--db-password cvsanaly "
"--db-database cvsanaly_android "
"--extensions=FileTypes "
" %(folder)s "
) % {
'folder': folder
}
subprocess.call(my_command, shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment