o
    tVg                     @   sN   d dl Z d dlZd dlmZmZ dd Zdd Zdd Zed	kr%e  dS dS )
    N)quote
urlunparsec                 c   s2    t j| \} }|rt| E d H  |V  d S d S )N)ospathsplit	_iterpath)r   last r	   H/home/ubuntu/.local/lib/python3.10/site-packages/pygame/docs/__main__.pyr      s   
r   c                  C   s0   t jt jt} t j| dd}t j|S )N	generated
index.html)r   r   dirnameabspath__file__joinexists)pkg_dir	main_pager	   r	   r
   has_local_docs   s   r   c                  C   s   t jt jt} t j| dd}t j|r=tdt|}t j	t\}}|r2| d| }t
dd|dddf}nd}t| d S )Nr   r   /file zhttps://www.pygame.org/docs/)r   r   r   r   r   r   r   r   r   
splitdriver   
webbrowseropen)r   r   url_pathdriveresturlr	   r	   r
   	open_docs   s   r   __main__)	r   r   urllib.parser   r   r   r   r   __name__r	   r	   r	   r
   <module>   s   
