
    @OOf<                     ^    d dl Z d dlZd dlZ G d d      Z ee      j                  d      Zy)    Nc                       e Zd Zd Zd Zd Zy)Datac                     || _         t        j                  |      }t        j                  |      }|J t
        j                  j                  |      }t
        j                  j                  |      | _        y )N)	name	importlibimport_moduleinspectgetsourcefileospathdirnameabspath)selfr   mfr   s        U/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/mitmproxy/utils/data.py__init__zData.__init__   sY    	##D)!!!$}}''//!$www/    c                     t         j                  j                  t         j                  j                  | j                  |            }t        | j                        }||_        |S )zJ
        Change the data object to a path relative to the module.
        )r   r   normpathjoinr   r   r   )r   subpathr   rets       r   pushz	Data.push   sD     ''""277<<g#FG499o
r   c                     t         j                  j                  t         j                  j                  | j                  |            }t         j                  j                  |      st        d|z        |S )z
        Returns a path to the package data housed at 'path' under this
        module.Path can be a path to a file, or to a directory.

        This function will raise ValueError if the path does not exist.
        zdataPath: %s does not exist.)r   r   r   r   r   exists
ValueError)r   r   fullpaths      r   r   z	Data.path   sQ     77##BGGLLt$DEww~~h';hFGGr   N)__name__
__module____qualname__r   r   r    r   r   r   r      s    0
r   r   z..)r   r	   os.pathr   r   r   r   pkg_datar"   r   r   <module>r%      s.       > >t$r   