ó
`Yc           @   s_  d  d l  Td  d l m Z d  d l m Z d  d l m Z d  d l m Z d  d l	 m
 Z
 m Z d  d l m Z d  d l Td  d l m Z d  d	 l m Z d  d
 l m Z d  d l m Z d  d l m Z d  d l Z d Z d Z d Z d „  Z d „  Z d „  Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ  d e f d „  ƒ  YZ! d S(   iÿÿÿÿ(   t   *(   t   Screen(   t
   MessageBox(   t   InputBox(   t	   ChoiceBox(   t	   ActionMapt   NumberActionMap(   t   ScrollLabel(   t   MenuList(   t   Input(   t   Console(   t   PluginDescriptorNs@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/Stato.txtsA   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/server.txts   2.3c         K   s$   y |  j  t ƒ Wn d GHn Xd  S(   Ns$   [ABBONAMENTO] Pluginexecution failed(   t   opent   Abbonamento(   t   sessiont   kwargs(    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyt   main   s    c         K   s   |  d k r d GHn  d  S(   Ni    s   [ABBONAMENTO] no autostart(    (   t   reasonR   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyt	   autostart!   s    c          K   s4   t  d t d ƒ d t d ƒ d t  j d d d t ƒ S(	   Nt   nameR   t   descriptions%   Stato di Abbonamento - By @Tiger Teamt   wheret   icons   abbonamento.pngt   fnc(   R   t   _t   WHERE_PLUGINMENUR   (   R   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyt   Plugins%   s    	R   c           B   s#   e  Z d  Z d d „ Z d „  Z RS(   s¿   
        <screen position="center,center" size="600,500" title="Abbonamento">
            <widget name="menu" position="10,10" size="490,390" scrollbarMode="showOnDemand" />
        </screen>i    c         C   sª   t  j |  _ | |  _ t j |  | ƒ | |  _ g  } | j t d ƒ d f ƒ | j t d ƒ d f ƒ t | ƒ |  d <t	 d d g i |  j
 d 6|  j d	 6d
 ƒ |  d <d  S(   Ns   Stato di Abbonamentot   readmes   Stato del Servert   readme2t   menut   WizardActionst   DirectionActionst   okt   backiÿÿÿÿt   actions(   R   t   skinR   R   t   __init__R   t   appendR   R   R   t   got   close(   t   selfR   t   argst   list(    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyR$   4   s    		c         C   s\  |  d j  j ƒ  d } | d  k	 rX| d k r? t |  j ƒ qX| d k r[ t |  j ƒ qX| d k r |  j j t t d ƒ d t	 g ƒ qX| d k r¿ |  j j t t d	 ƒ d
 t	 g ƒ qX| d k rñ |  j j t t d ƒ d t	 g ƒ qX| d k r#|  j j t t d ƒ d t	 g ƒ qX| d k rU|  j j t t d ƒ d t	 g ƒ qX| d k rqt
 |  j ƒ qX| d k rt |  j ƒ qX| d k r¿|  j j t t d ƒ d t g ƒ qX| d k rñ|  j j t t d ƒ d t g ƒ qX| d k r#|  j j t t d ƒ d t	 g ƒ qX| d k rX|  j j t t d t ƒ t j ƒ qXn  d  S(    NR   i   t
   addwizzardt   laterwizzardR*   s   Listing crontabs   %s listt   deletes   Deleting crontabs	   %s deletet   reloads   Reloading crontabs	   %s reloadt   infos   showing Abbonamento Infos   %s infot   times   showing system time s   %s timet
   changetimet   restartwizzardR   s   Stato di Abbonamentos   cat %sR   s   Stato Servert   helps"   short help on Abbonamento commandss   %st   abouts1   Abbonamento Enigma2 Plugin Version %s by gutemine(   t   lt   getCurrentSelectiont   Nonet   AddCommandWizzardR   t   LaterCommandWizzardR   R
   R   t   abbonamento_scriptt   ChangeTimeWizzardt   RestartWizzardt   abbonamento_readmet   abbonamento_readme2R   t   abbonamento_pluginversiont	   TYPE_INFO(   R(   t   returnValue(    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyR&   ?   s8    &&&&&&&&(   t   __name__t
   __module__R#   R$   R&   (    (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyR   .   s   R8   c           B   s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  |  j ƒ  d  S(   N(   R   t   askForCommand(   R(   R   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyR$   ^   s    	c         C   s;   |  j  j |  j t d t d ƒ d d d t d t j ƒd  S(   Nt   titles!   Enter a script to execute at timet   texts   /etc/cron/examples/rmc.sh 30 8t   maxSizet   type(   R   t   openWithCallbackt   processingCommandR   R   t   FalseR	   t   TEXT(   R(   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRD   c   s    c         C   s[   | d  k r" |  j t d ƒ ƒ n5 | |  _ |  j j |  j t t d |  j ƒ t j ƒ d  S(   NsB   Script for adding to crontab is NONE, skipping crontab add commands0   are you sure to add this script to crontab: %s ?(	   R7   t   skipCommandR   t
   targetnameR   RI   t	   DoCommandR   t
   TYPE_YESNO(   R(   RN   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRJ   f   s    	c         C   s   | d  k r" |  j t d ƒ ƒ n  | t k rD |  j t d ƒ ƒ nE t d ƒ |  j } d t |  j f } |  j j t t | ƒ | g ƒ d  S(   Ns   answer is Nones   you were not confirmings%   adding script %s to crontab with times	   %s add %s(	   R7   RM   R   RK   RN   R:   R   R   R
   (   R(   t   answerRE   t   cmd(    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRO   m   s    c         C   s'   |  j  j t t d ƒ | t j ƒ d  S(   Ns.   add script to crontab was canceled, because %s(   R   R   R   R   t   TYPE_WARNING(   R(   R   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRM   w   s    (   RB   RC   R$   RD   RJ   RO   RM   (    (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyR8   ]   s
   				
R9   c           B   s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  |  j ƒ  d  S(   N(   R   t   askForLaterCommand(   R(   R   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyR$   {   s    	c         C   s;   |  j  j |  j t d t d ƒ d d d t d t j ƒd  S(   NRE   s$   Enter a script to execute with delayRF   s   /etc/cron/examples/slt.sh 60RG   RH   (   R   RI   t   processingLaterCommandR   R   RK   R	   RL   (   R(   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRT   €   s    c         C   s[   | d  k r" |  j t d ƒ ƒ n5 | |  _ |  j j |  j t t d ƒ |  j t j ƒ d  S(   NsD   Script for adding to crontab is NONE, skipping crontab delay commands0   are you sure to add this script to crontab: %s ?(	   R7   t   skipLaterCommandR   RN   R   RI   t   DoLaterCommandR   RP   (   R(   RN   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRU   ƒ   s    	c         C   s   | d  k r" |  j t d ƒ ƒ n  | t k rD |  j t d ƒ ƒ nE t d ƒ |  j } d t |  j f } |  j j t t | ƒ | g ƒ d  S(   Ns   answer is Nones   you were not confirmings&   adding script %s to crontab with delays   %s delay %s(	   R7   RV   R   RK   RN   R:   R   R   R
   (   R(   RQ   RE   RR   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRW   Š   s    c         C   s'   |  j  j t t d ƒ | t j ƒ d  S(   Ns0   delay script to crontab was canceled, because %s(   R   R   R   R   RS   (   R(   R   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRV   ”   s    (   RB   RC   R$   RT   RU   RW   RV   (    (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyR9   z   s
   				
R<   c           B   s>   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   | |  _  |  j ƒ  d  S(   N(   R   t   askForRestart(   R(   R   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyR$   ˜   s    	c         C   s,   |  j  j |  j t t d ƒ |  j ƒ  ƒ d  S(   Ns%   select restart command to be executed(   R   RI   RD   R   R   t   getCommandList(   R(   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRX   œ   s    c         C   s_   | d  k r" |  j t d ƒ ƒ n9 | d |  _ |  j j |  j t t d ƒ |  j t j ƒ d  S(   Ns#   no command passed, skipping restarti   s   are you sure to %s(	   R7   t   skipRestartR   t   sourceR   RI   t   restartCommandR   RP   (   R(   R[   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRD   Ÿ   s    c         C   s†   | d  k r" |  j t d ƒ ƒ n  | t k rD |  j t d ƒ ƒ n> t d ƒ } d t |  j f } |  j j t t | ƒ | g ƒ d  S(   Ns   answer is Nones   you were not confirmings   executing command on Dreamboxs   %s %s(	   R7   RZ   R   RK   R:   R[   R   R   R
   (   R(   RQ   RE   RR   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyR\   ¦   s    c         C   s'   |  j  j t t d ƒ | t j ƒ d  S(   Ns    restart was canceled, because %s(   R   R   R   R   RS   (   R(   R   (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRZ   °   s    c         C   s¹   g  } | j  t d ƒ d f ƒ | j  t d ƒ d f ƒ | j  t d ƒ d f ƒ | j  t d ƒ d f ƒ | j  t d	 ƒ d
 f ƒ | j  t d ƒ d f ƒ | j  t d ƒ d f ƒ | S(   Ns   info if cron daemon is runningR/   s   start cron daemont   starts   stop cron daemont   stops   restart cron daemont   restarts   reboot Dreamboxt   reboots   halt Dreamboxt   halts   restart Enigma on Dreamboxt   kill(   R%   R   (   R(   t   images(    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyRY   ³   s    (   RB   RC   R$   RX   RD   R\   RZ   RY   (    (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyR<   —   s   				
	("   t   enigmat   Screens.ScreenR   t   Screens.MessageBoxR   t   Screens.InputBoxR   t   Screens.ChoiceBoxR   t   Components.ActionMapR   R   t   Components.ScrollLabelR   t   Components.GUIComponentt   Components.MenuListR   t   Components.InputR	   t   Screens.ConsoleR
   t   Plugins.PluginR   t   osR=   R>   R?   R   R   R   R   R8   R9   R<   (    (    (    s@   /usr/lib/enigma2/python/Plugins/Extensions/Abbonamento/plugin.pyt   <module>   s.   

				/