î
ªÍ XØ  ã               @   sF   d  d l  m Z m Z d  d l m Z m Z Gd d „  d e ƒ Z d S)é    )ÚBaseCommandÚCommandError)ÚDEFAULT_DB_ALIASÚconnectionsc               @   s4   e  Z d  Z d Z d Z d d „  Z d d „  Z d S)ÚCommandzaRuns the command-line client for specified database, or the default database if none is provided.Fc          
   C   s)   | j  d d d d d d t d d ƒd  S)	Nz
--databaseÚactionÚstoreÚdestÚdatabaseÚdefaultÚhelpzTNominates a database onto which to open a shell. Defaults to the "default" database.)Úadd_argumentr   )ÚselfÚparser© r   úU/home/ubuntu/projects/ifolica/build/django/django/core/management/commands/dbshell.pyÚadd_arguments   s    zCommand.add_argumentsc             K   sN   t  | d } y | j j ƒ  Wn( t k
 rI t d | j j ƒ ‚ Yn Xd  S)Nr
   z@You appear not to have the %r program installed or on your path.)r   ÚclientZrunshellÚOSErrorr   Zexecutable_name)r   ÚoptionsÚ
connectionr   r   r   Úhandle   s    zCommand.handleN)Ú__name__Ú
__module__Ú__qualname__r   Zrequires_system_checksr   r   r   r   r   r   r      s   r   N)Zdjango.core.management.baser   r   Z	django.dbr   r   r   r   r   r   r   Ú<module>   s   