mò
ÂeìEc           @   sk   d  k  Z  d  k Z d  k Z d  k Z d  k Z d k l Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d  S(   N(   s   drPreferencesc         C   s   t  i |  | d t  i ƒ d  S(   Nt   Debuging(   t   wxt
   MessageBoxt   windowt   stringt   OK(   R   R   (    (    t2   C:/drpython/drpython28/plugins\PyCheckerSupport.pyt   MsgBox   s    c         C   sC   d } | d } t i i i |  | d ƒ } | i ƒ  | i	 ƒ  d  S(   Ns(   Python Checker Support:

Version: 0.0.1
sJ   By Nathan Jones
Based on code by Daniel Pozmanter

Released under the GPL.t   About(
   t   NameAndVersiont   AboutStringR   t   libt   dialogst   ScrolledMessageDialogt   DrFramet   dt	   ShowModalt   Destroy(   R   R
   R	   R   (    (    R   t   OnAbout"   s
    

c         C   sC   d } | d } t i i i |  | d ƒ } | i ƒ  | i ƒ  d  S(   Ns=   To install set the location of checker.py in the preferences
s   Then run using the menu optiont   Help(	   t
   HelpStringR   R   R   R   R   R   R   R   (   R   R   R   (    (    R   t   OnHelp)   s
    

c         C   sŠ   t  i |  d d d d t  i ƒ } | i ƒ  t  i j oE | i ƒ  } t	 |  i
 d d ƒ } | i d | d ƒ | i ƒ  n | i ƒ  d  S(   Ns   Select Pycheckert    s%   Python Source (*.py *.pyw)|*.py;*.pyws   /Pycheck.preferences.datt   ws   <Pycheck.Location>s   </Pycheck.Location>(   R   t
   FileDialogR   t   OPENt   dlgR   t   ID_OKt   GetPatht   PycheckLocationt   filet   pluginspreferencesdirectoryt   ft   writet   closeR   (   R   R   R    R   (    (    R   t   OnPreferences/   s    !c            sx   ˆ  i ƒ  } ˆ  i d ƒ ˆ  i i ƒ  ˆ  i i | d d ƒ ‡  d †  } ˆ  i t	 i
 | d | ƒˆ  i d d | ƒ d  S(   Nt   PyCheckerSupports!   Check program with python checkers.    Check the current program with python checkerc            sf  ˆ  i i ƒ  oD t i d d t i t i Bƒ } | t i j o ˆ  i	 |  ƒ qT n t i i ˆ  i d ƒ o× ˆ  i d } t | d ƒ } | i ƒ  } | i ƒ  t i | d ƒ } t i i | ƒ t j o' d } t i d d t i t i Bƒ n | d j oB d | d	 ˆ  i i d GHˆ  i d | d	 ˆ  i i d ƒ qbn t i d d t i t i Bƒ d  S(
   Nse   The file has been modified.
It would be wise to save before running.
Would you like to save the file?t   DrPythons   /Pycheck.preferences.datt   rs   Pycheck.LocationR   sB   Location of Pychecker has not been set up.
Please set it up first.t   "s   " "(   R   t   txtDocumentt	   GetModifyR   R   t   YES_NOt   ICON_QUESTIONt   answert   YESt   OnSavet   eventt   ost   patht   existsR   t   HomeDirR   R    t   readt   textR"   t   drPrefsFilet   ExtractPreferenceFromTextt   Locationt   TrueR   t   ICON_EXCLAMATIONt   filenamet   Execute(   R/   R3   R    R5   R8   R,   (   R   (    R   t   OnRunPythonChecker@   s"    
!+t   idt   PycheckSupportR=   (   R   t   GetNewIdt   ID_PYTHON_CHECKERt   LoadPluginShortcutst   programmenut   AppendSeparatort   AppendR=   t   BindR   t   EVT_MENUt   AddPluginShortcutFunction(   R   RA   R=   (    (   R   R   t   Plugin8   s    (   t   syst   os.pathR0   R   t   wx.lib.dialogsR6   t   drPreferencesR   R   R   R#   RI   (
   RM   RI   R0   R   R#   RJ   R   R   R6   R   (    (    R   t   ?   s   						