³ò
°QþNc           @   s¡   d  Z  d d k Z d d k Z d d k Z d d k l Z d d k Z d d k Z d d k Z d d k l	 Z	 d d k
 l Z d e i i i f d „  ƒ  YZ d S(   sL   
    KeepNote Extension 
    notebook_html

    Command-line basic commands
iÿÿÿÿN(   t
   AppCommand(   t   NoteBookConnectionFS(   t   NoteBookHttpServert	   Extensionc           B   s5   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   s   t  i i i i |  | ƒ | |  _ |  i i |  i ƒ h  |  _	 t
 d |  i d d d d ƒt
 d |  i d d d d ƒg |  _ d	 S(
   s   Initialize extensions
   start-httpt   metavars   PORT NOTEBOOKt   helps'   start HTTP server on PORT with NOTEBOOKs	   stop-httpt   PORTs   stop HTTP server on port PORTN(   t   keepnotet   guit	   extensionR   t   __init__t   appt   enabledt   addt
   on_enabledt   _portsR    t
   start_httpt	   stop_httpt   commands(   t   selfR   (    (    s™   \\192.168.178.73\Gero\!!!!!!!!!!!!!!! Neue Aufgaben ab 26.02.2022\2 Datenbank portable\KeepNotePortable\App\KeepNote\extensions\notebook_http\__init__.pyR
   .   s    				c         C   s   d d d f g S(   NR   s   >=i    i   i   (   i    i   i   (    (   R   (    (    s™   \\192.168.178.73\Gero\!!!!!!!!!!!!!!! Neue Aufgaben ab 26.02.2022\2 Datenbank portable\KeepNotePortable\App\KeepNote\extensions\notebook_http\__init__.pyt   get_dependsD   s    c         C   sº   | oˆ x¬ |  i  D]v } |  i i | i ƒ o q n y |  i i | ƒ Wq t j
 o0 } |  i i d | i | t i ƒ  d ƒ q Xq Wn( x$ |  i  D] } |  i i	 | i ƒ q™ Wd  S(   Ns   Could not add command '%s'i   (
   R   R   t   get_commandt   namet   add_commandt	   Exceptiont   errort   syst   exc_infot   remove_command(   R   R   t   commandt   e(    (    s™   \\192.168.178.73\Gero\!!!!!!!!!!!!!!! Neue Aufgaben ab 26.02.2022\2 Datenbank portable\KeepNotePortable\App\KeepNote\extensions\notebook_http\__init__.pyR   H   s    
 !
 c   	      C   sÛ   t  | d ƒ } t | d ƒ } t ƒ  } | i | ƒ d } d | | f } t | d d d | ƒ} | |  i j o t d | ƒ ‚ n | |  i | <t i d | ƒ t	 i
 | i d
 ƒ | d j o t i d	 ƒ n d  S(   Ni   i   t	   localhosts   http://%s:%d/t   hostt   ports   Server already on port %ds   starting server:
%s
sC   NOTE: server is local only.  Use ssh port forwarding for security.
(    (   t   intt   unicodeR   t   connectR   R   R   R   t   log_messaget   threadt   start_new_threadt   serve_forever(	   R   R   t   argsR!   t   notebook_patht   connR    t   urlt   server(    (    s™   \\192.168.178.73\Gero\!!!!!!!!!!!!!!! Neue Aufgaben ab 26.02.2022\2 Datenbank portable\KeepNotePortable\App\KeepNote\extensions\notebook_http\__init__.pyR   \   s    	c         C   sj   t  | d ƒ } | |  i j o t d | ƒ ‚ n |  i | } t i d | ƒ | i ƒ  |  i | =d  S(   Ni   s   No server is on port %ds   stopping server on port %d...
(   R"   R   R   R   R%   t   shutdown(   R   R   R)   R!   R-   (    (    s™   \\192.168.178.73\Gero\!!!!!!!!!!!!!!! Neue Aufgaben ab 26.02.2022\2 Datenbank portable\KeepNotePortable\App\KeepNote\extensions\notebook_http\__init__.pyR   v   s    
(   t   __name__t
   __module__R
   R   R   R   R   (    (    (    s™   \\192.168.178.73\Gero\!!!!!!!!!!!!!!! Neue Aufgaben ab 26.02.2022\2 Datenbank portable\KeepNotePortable\App\KeepNote\extensions\notebook_http\__init__.pyR   ,   s
   				(   t   __doc__R   R&   R   R    t   keepnote.notebookt   keepnote.extensiont   keepnote.gui.extensiont   keepnote.notebook.connection.fsR   t!   keepnote.notebook.connection.httpR   R   R	   R   (    (    (    s™   \\192.168.178.73\Gero\!!!!!!!!!!!!!!! Neue Aufgaben ab 26.02.2022\2 Datenbank portable\KeepNotePortable\App\KeepNote\extensions\notebook_http\__init__.pys   <module>   s   