Ë
    ü[;jÌ  ã                   ó€   — d Z ddlZddlmZ ddlZddlZddlZdZd„ Zd„ Zd„ Z	d„ Z
ed	k(  r e
ej                  «       yy)
zšEnables use of Python Fire as a "main" function (i.e. "python -m fire").

This allows using Fire with third-party libraries without modifying their code.
é    N)Úutila›  usage: python -m fire [module] [arg] ..."

Python Fire is a library for creating CLIs from absolutely any Python
object or program. To run Python Fire from the command line on an
existing Python file, it can be invoked with "python -m fire [module]"
and passed a Python module using module notation:

"python -m fire packageA.packageB.module"

or with a file path:

"python -m fire packageA/packageB/module.py" c                 óZ  — t         j                  j                  | «      st        d«      ‚t         j                  j	                  | «      }t        j                  || «      }|�|j                  €t        d«      ‚t        j                  |«      }|j                  j                  |«       ||fS )aL  Performs a module import given the filename.

  Args:
    path (str): the path to the file to be imported.

  Raises:
    IOError: if the given file does not exist or importlib fails to load it.

  Returns:
    Tuple[ModuleType, str]: returns the imported module and the module name,
      usually extracted from the path itself.
  zGiven file path does not exist.z*Unable to load module from specified path.)
ÚosÚpathÚexistsÚOSErrorÚbasenamer   Úspec_from_file_locationÚloaderÚmodule_from_specÚexec_module)r   Úmodule_nameÚspecÚmodules       úVG:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\fire/__main__.pyÚimport_from_file_pathr   *   s�   € ô 
�‰�‰˜Ô	Ü
Ð3Ó
4Ð4ä—‘× Ñ  Ó&€+ä	×	%Ñ	% k°4Ó	8€$à	€\�T—[‘[Ð(Ü
Ð>Ó
?Ð?ä× Ñ  Ó&€&Ø‡+�+×Ñ˜&Ô!à	�Ð	Ðó    c                 ó4   — t        j                  | «      }|| fS )z-Imports a module and returns it and its name.)Ú	importlibÚimport_module)r   r   s     r   Úimport_from_module_namer   H   s   € ä×"Ñ" ;Ó/€&Ø	�Ð	Ðr   c                 ó$  — t         j                  j                  | «      r(| j                  d«      s	 t	        | «      S t        | «      S t         j                  j                  | v rt        d«      ‚t	        | «      S # t
        $ r t        d«      ‚w xY w)a  Imports a given module or filename.

  If the module_or_filename exists in the file system and ends with .py, we
  attempt to import it. If that import fails, try to import it as a module.

  Args:
    module_or_filename (str): string name of path or module.

  Raises:
    ValueError: if the given file is invalid.
    IOError: if the file or module can not be found or imported.

  Returns:
    Tuple[ModuleType, str]: returns the imported module and the module name,
      usually extracted from the path itself.
  z.pyz%Fire can only be called on .py files.z4Fire was passed a filename which could not be found.)
r   r   r   Úendswithr   ÚImportErrorÚ
ValueErrorr   Úsepr   )Úmodule_or_filenames    r   r   r   N   s‹   € ô$ ‡W�W‡^�^Ð&Ô'à×&Ñ& uÔ-ðBÜ&Ð'9Ó:Ð:ô !Ð!3Ó4Ð4ä‡W�W‡[�[Ð&Ñ&Ü
ÐHÓ
IÐIä	 Ð!3Ó	4Ð4øô ò BÜÐ@ÓAÐAðBús   ²
A: Á:Bc                 óÄ   — t        | «      dk  r$t        t        «       t        j                  d«       | d   }t        |«      \  }}t        j                  ||| dd ¬«       y)zAEntrypoint for fire when invoked as a module with python -m fire.é   é   N)ÚnameÚcommand)ÚlenÚprintÚ
cli_stringÚsysÚexitr   ÚfireÚFire)Úargsr   r   r   s       r   Úmainr+   p   sR   € ô 	ˆƒY�‚]Ü	Œ*ÔÜ‡H�HˆQ„Kà˜A‘wÐÜ%Ð&8Ó9Ñ€&ˆ+ä‡)�)ˆF˜¨d°1°2¨hÖ7r   Ú__main__)Ú__doc__r   r   r   r&   r(   r%   r   r   r   r+   Ú__name__Úargv© r   r   Ú<module>r1      sQ   ðñ ó
 Ý Û 	Û 
ã ð1€
òò<ò5òD
8ð ˆzÒÙ€s‡x�x….ð r   