fastmonkeys / stellar

Fast database snapshot and restore tool for development
MIT License
3.86k stars 119 forks source link

bugfix: Fix TypeError exception when showing message that a required library is not installed #41

Closed gbourdin closed 10 years ago

gbourdin commented 10 years ago

This fixed a minor string formatting issue that was causing a TypeError to be raised whenever the a user tried to connect to a database for which the required library was not installed.

This was preventing the help message from being displayed.

This is what was happening

Please enter the url for your database.

For example:
PostgreSQL: postgresql://localhost:5432/
MySQL: mysql+pymysql://root@localhost/: postgresql://localhost:5432/

Traceback (most recent call last):
  File ",,,/bin/stellar", line 9, in <module>
    load_entry_point('stellar==0.4.1', 'console_scripts', 'stellar')()
  File ".../local/lib/python2.7/site-packages/stellar/command.py", line 280, in main
    library,
TypeError: not enough arguments for format string

And this is how it looks now that it's fixed, which I assume is what it was initially intended to look like:

Please enter the url for your database.

For example:
PostgreSQL: postgresql://localhost:5432/
MySQL: mysql+pymysql://root@localhost/: postgresql://localhost:5432/

Python library psycopg2 is required for PostreSQL support.
You can install it with pip:
pip install psycopg2
Teemu commented 10 years ago

Thanks for the PR!

gbourdin commented 10 years ago

@Frozenball Thank you!