
    Pi                    4    d Z ddlmZ ddlmZmZ dgZdd	Zd
S )z
Sample command handler for Dippy.

The sample command profiles a process and writes output to a file.
By default it writes to /tmp which is safe; custom paths need approval.
    )annotations)ClassificationHandlerContextsamplectxr   returnr   c                   | j         }t          |          dk     rt          dd          S d}|t          |          k     r||         }|dk    rp|dz   t          |          k     rZ||dz            }|                    d          s|                    d          rt          d	d
          S t          dd|           S |dz  }|t          |          k     t          d	d          S )zClassify sample command.   askzsample (no target))description   z-filez/tmp/z/tmpallowzsample -file /tmp/...zsample -file zsample (default /tmp output))tokenslenr   
startswith)r   r   itokfilepaths        1/root/projects/gits/Dippy/src/dippy/cli/sample.pyclassifyr      s   ZF
6{{Qe1EFFFF 	
A
c&kk//Qi'>>a!ec&kk11a!e}H""7++ Tx/B/B6/J/J T%g;RSSSS!%5OX5O5OPPPP	Q c&kk// '/MNNNN    N)r   r   r   r   )__doc__
__future__r   	dippy.clir   r   COMMANDSr    r   r   <module>r      sf     # " " " " " 4 4 4 4 4 4 4 4:O O O O O Or   