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LZMZUzDeL ceM¡ deM¡ZZd(Z]e^eZd=ƒr`d> _eZj¡Z]eT Qd? _eUeMe]¡¡ W n< eRk
r² Z` ze 2dA _eUeMeae`ƒ¡¡ W 5 dZ`[`X Y nX q(eedBdC„ dDD ƒƒrÔdEedF< dGejfd krìdEedH< eedIdC„ ejfD ƒƒr
dEedJ< eedKdC„ ejfD ƒƒr(dEedL< e 8dH¡sdMekrLeedM ƒZ>n>edNƒZgedOkrhedP ZgnedQkr€eedNƒdRƒZgeegdSƒZ>ee>dTƒZ?ee>dUƒZ@ee>dVƒZhdWekree>ƒsÄee>ƒ ee@ƒsÖee@ƒ eehƒsze iee:dXƒeh¡ W n   e 3dY¡ Y nX ddZljmkZk e 8ek 8d[d\¡¡Zlejmeld] dJekr^dLekr^e 8d^d_¡d&kr^ejfZnejfdd`… e_fz<eend`d… dadbdcdddedfdgdhdidjdkdldmdndodpdqgƒ\ZoZpW nF ek
rö Zq z&e rdreaeqƒ ¡ e'ƒ  e sd¡ W 5 dZq[qX Y nX dZtz(eoD ]\ZuZveudskrdtZt q"qW n   Y nX endd`… ep e_fetdk	rfejf Pd`ds¡ ng Zog ZpduZweoD ]´\ZuZveudvkr–e'ƒ  e sd¡ qneudwkrÞz"ev /dxd`¡\ZxZpek ydyexep¡ W n ezk
rØ   Y nX qneudzkrúek yd{dcd|¡ qneud}k	r¦ev /dxd¡Z{e|e{ƒdk	r6ek ye{d e{d` d(¡ n2e|e{ƒd~k	r`ek ye{d e{d` e{d ¡ ne1dƒ‚e{d d[kr"e{d` d\kr"e 8ek 8d[d\¡¡Zlejmeld] qneud€k	rÂek yd{dcd¡ qneud‚k	rÞek yd{dcdE¡ qneudƒk	rúek yd{dcd„¡ qneud…k
r4eaevƒ /d†¡\Z}Z~ek yd{d‡e}¡ ek yd{dˆe~¡ nîeud‰k
rRek yd{dŠeaevƒ¡ nÐeud‹k
rÄeaevƒdŒk
rˆddlm€Z€ e€ ¡  e sd¡ ev /dxd`¡Zpe|epƒd`k
r¬epd(g7 Zpek yd*epd epd` ¡ n^eudŽk
rÔdtZwnNeudk
rîek yd{dev¡ n4eud‘kre 8dp¡Zlejmeld] neud’krneved“< qnewr¤dWekr¤z$e‚e?d”ƒZƒek „eƒ¡ W 5 Q R X W n4 e1k
rŽ Z` ze 3d•eae`ƒ¡ W 5 dZ`[`X Y nX e …d–¡ e sd¡ ddlm€Z€ e€ †¡  ed—krðddZljmkZk ek yd{dcd|¡ ek ‡dy¡ ek ˆdy¡ edOkrek ydyd˜dO¡ eTD ]Z‰e …e‰¡ qesNerNerNe …d™eeddš… ef ¡ ne …d›e ¡ e …dœ _e6¡¡ e …d _ej]¡¡ e …dž _ejŠ¡¡ ddŸlm‹Z‹ e‹dk	r®e‹ Œ¡  dS ) aJ  
Kivy framework
==============

Kivy is an open source library for developing multi-touch applications. It is
cross-platform (Linux/OSX/Windows/Android/iOS) and released under
the terms of the `MIT License <https://en.wikipedia.org/wiki/MIT_License>`_.

It comes with native support for many multi-touch input devices, a growing
library of multi-touch aware widgets and hardware accelerated OpenGL drawing.
Kivy is designed to let you focus on building custom and highly interactive
applications as quickly and easily as possible.

With Kivy, you can take full advantage of the dynamic nature of Python. There
are thousands of high-quality, free libraries that can be integrated in your
application. At the same time, performance-critical parts are implemented
using `Cython <http://cython.org/>`_.

See http://kivy.org for more information.
)ÚrequireÚparse_kivy_versionÚkivy_configureÚ kivy_register_post_configurationÚkivy_optionsÚkivy_base_dirÚkivy_modules_dirÚkivy_data_dirÚkivy_shader_dirÚkivy_icons_dirÚkivy_home_dirÚkivy_config_fnÚkivy_usermodules_dirÚkivy_examples_diré    N)ÚgetoptÚGetoptError)ÚenvironÚmkdir)ÚdirnameÚjoinÚbasenameÚexistsÚ
expanduser)ÚLoggerÚ
LOG_LEVELS)Úplatform)Ú__version__ÚRELEASEÚ_kivy_git_hashÚ_kivy_build_dateÚmacosxl   ÿÿÿÿ a\  Unsupported Python version detected!:
    Kivy requires a 64 bit version of Python to run on OS X. We strongly
    advise you to use the version of Python that is provided by Apple
    (don't use ports, fink or homebrew unless you know what you're
    doing).
    See http://kivy.org/docs/installation/installation-macosx.html for
    details.
    é   zÄUnsupported Python version detected!: Kivy 2.0.0 and higher does not support Python 2. Please upgrade to Python 3, or downgrade Kivy to 1.11.0 - the last Kivy release that still supports Python 2.c                 C   sb   t  d| ¡}|dkrtdƒ‚| ¡ \}}}}}|dkr:d}|dkrFd}t|ƒt|ƒt|ƒg||fS )zºParses the kivy version as described in :func:`require` into a 3-tuple
    of ([x, y, z], 'rc|a|b|dev|post', 'N') where N is the tag revision. The
    last two elements may be None.
    z>^([0-9]+)\.([0-9]+)\.([0-9]+?)(rc|a|b|\.dev|\.post)?([0-9]+)?$Nz#Revision format must be X.Y.Z[-tag]z.devÚdevz.postÚpost)ÚreÚmatchÚ	ExceptionÚgroupsÚint)ÚversionÚmÚmajorÚminorÚmicroÚtagÚtagrev© r0   ú1/tmp/pip-unpacked-wheel-xzebddm3/kivy/__init__.pyr   C   s    þr   c                 C   sb   t | ƒ\}}}t tƒ\}}}|r6|s6t dt| f ¡ |dk	rFtdƒ‚||k r^tdt| f ƒ‚dS )a¹  Require can be used to check the minimum version required to run a Kivy
    application. For example, you can start your application code like this::

        import kivy
        kivy.require('1.0.1')

    If a user attempts to run your application with a version of Kivy that is
    older than the specified version, an Exception is raised.

    The Kivy version string is built like this::

        X.Y.Z[tag[tagrevision]]

        X is the major version
        Y is the minor version
        Z is the bugfixes revision

    The tag is optional, but may be one of '.dev', '.post', 'a', 'b', or 'rc'.
    The tagrevision is the revision number of the tag.

    .. warning::

        You must not ask for a version with a tag, except -dev. Asking for a
        'dev' version will just warn the user if the current Kivy
        version is not a -dev, but it will never raise an exception.
        You must not ask for a version with a tagrevision.

    z[Application requested a dev version of Kivy. (You have %s, but the application requires %s)Nz0Revision format must not contain any tagrevisionzgThe version of Kivy installed on this system is too old. (You have %s, but the application requires %s))r   r   r   Úwarningr&   )r)   Úrevisionr.   r/   ZsysrevisionZsystagZ	systagrevr0   r0   r1   r   V   s      ÿÿ ÿþr   c                  C   s   t D ]
} | ƒ  qdS )ziCall post-configuration of Kivy.
    This function must be called if you create the window yourself.
    N)Ú__kivy_post_configuration©Úcallbackr0   r0   r1   r   ‰   s    r   c                  C   s&   t tƒ} t| dƒt| ddƒt| dƒgS )zÑRetrieves the directories containing includes needed to build new Cython
    modules with Kivy as a dependency. Currently returns the location of the
    kivy.graphics module.

    .. versionadded:: 1.9.1
    ÚgraphicsZtoolsZgles_compatÚinclude)r   Ú__file__r   )Úroot_dirr0   r0   r1   Úget_includes‘   s    ÿr;   c                 C   s   t  | ¡ dS )zsRegister a function to be called when kivy_configure() is called.

    .. warning::
        Internal use only.
    N)r4   Úappendr5   r0   r0   r1   r      s    r   c                   C   s   t tjttjd ƒ ƒ dS )a  Kivy Usage: %s [KIVY OPTION...] [-- PROGRAM OPTIONS]::

            Options placed after a '-- ' separator, will not be touched by kivy,
            and instead passed to your program.

            Set KIVY_NO_ARGS=1 in your environment or before you import Kivy to
            disable Kivy's argument parser.

        -h, --help
            Prints this help message.
        -d, --debug
            Shows debug log.
        -a, --auto-fullscreen
            Force 'auto' fullscreen mode (no resolution change).
            Uses your display's resolution. This is most likely what you want.
        -c, --config section:key[:value]
            Set a custom [section] key=value in the configuration object.
        -f, --fullscreen
            Force running in fullscreen mode.
        -k, --fake-fullscreen
            Force 'fake' fullscreen mode (no window border/decoration).
            Uses the resolution specified by width and height in your config.
        -w, --windowed
            Force running in a window.
        -p, --provider id:provider[,options]
            Add an input provider (eg: ccvtable1:tuio,192.168.0.1:3333).
        -m mod, --module=mod
            Activate a module (use "list" to get a list of available modules).
        -r, --rotation
            Rotate the window's contents (0, 90, 180, 270).
        -s, --save
            Save current Kivy configuration.
        --size=640x480
            Size of window geometry.
        --dpi=96
            Manually overload the Window DPI (for testing only.)
    r   N)ÚprintÚ
kivy_usageÚ__doc__r   ÚsysÚargvr0   r0   r0   r1   r>   ¦   s    &r>   )Zegl_rpiÚsdl2ÚpygameZsdlZx11)ÚpilrB   rC   Zsdlttf)Ú	gstplayerZffmpegÚ
ffpyplayerÚnull)rE   rC   rF   rB   Zavplayer)ZtexZimageioZddsrB   rC   rD   ZffpyZgif)ZopencvZgiZavfoundationÚandroidZpicamera)ZenchantZ	osxappkit)
rH   Z	winctypesZxselZxclipZdbusklipperZnspasterB   rC   ÚdummyZgtk3)ZwindowÚtextÚvideoÚaudioÚimageZcameraZspellingZ	clipboardzKIVY_%sú,)ÚtrueÚ1Úyesz(Core: Wrong value for %s environment keyÚ ZKIVY_MODULES_DIRÚmodulesZKIVY_DATA_DIRÚdataZKIVY_BINARY_DEPSZbinary_depsZglslZiconsZexamplesÚsharezkivy-examplesz/usr/share/kivy-examplesz/usr/local/share/kivy-examplesz~/.local/share/kivy-examplesc                 C   sz   dd l }g }tj|jfD ]V}t|d|dƒ}tj |¡r|tj tj	d  tj	d< t
tdƒrdt |¡ | |¡ q|| _d S )Nr   rU   ÚbinÚPATHÚadd_dll_directory)Úsiter@   ÚprefixÚ	USER_BASEr   ÚosÚpathÚisdirÚpathsepr   ÚhasattrrX   r<   Údep_bins)Zdep_modÚmod_namerY   ra   ÚdÚpr0   r0   r1   Ú_patch_mod_deps_win  s    

re   )ÚdepsZgstz	kivy.depsÚ	kivy_depsr   z {}z%deps: Successfully imported "{}.{}"{}z0.3.3z,deps: Error importing dependency "{}.{}": {}c                 c   s   | ]}|t jd  kV  qdS )r   N)r@   rA   )Ú.0Únamer0   r0   r1   Ú	<genexpr>y  s     rj   )úsphinx-buildzautobuild.pyZsphinxrP   ZKIVY_DOCrk   ZKIVY_DOC_INCLUDEc                 c   s   | ]}d |kV  qdS )ZpytestNr0   ©rh   Úargr0   r0   r1   rj     s     ZKIVY_UNITTESTc                 c   s   | ]}d |  ¡ kV  qdS )ZpyinstallerN)Úlowerrl   r0   r0   r1   rj     s     ZKIVY_PACKAGINGZ	KIVY_HOMEú~rH   ZANDROID_APP_PATHÚiosZ	Documentsz.kivyz
config.iniZmodsZiconZKIVY_NO_CONFIGZlogoz!Error when copying logo directory)ÚConfigÚkivyZ	log_level)ÚlevelZKIVY_NO_ARGSÚfalseé   zhp:fkawFem:sr:dc:ÚhelpZ
fullscreenZwindowedZfpsÚeventzmodule=Úsavezfake-fullscreenzauto-fullscreenzmultiprocessing-forkzdisplay=zsize=zrotate=zconfig=Údebugzdpi=zCore: %sz--multiprocessing-forkTF)z-hz--help)z-pz
--providerú:Úinput)z-az--auto-fullscreenr7   Úauto)z-cz--configé   zInvalid --config value)z-kz--fake-fullscreenZfake)z-fz--fullscreen)z-wz
--windowedÚ0)z--sizeÚxÚwidthÚheight)z	--displayZdisplay)z-mz--moduleÚlist)ÚModules)z-sz--save)z-rz
--rotationZrotation)z-dz--debugz--dpiZKIVY_DPIÚwz3Core: error while saving defaultconfiguration file:zCore: Kivy configuration saved.)rH   rp   ZandroidtouchzKivy: v%s, git-%s, %sé   z	Kivy: v%szKivy: Installed at "{}"zPython: v{}zPython: Interpreter at "{}")Úfile_log_handler)r?   Ú__all__r@   Úshutilr   r   r\   r   r   Úos.pathr   r   r   r   r   Úpkgutilr$   Ú	importlibZkivy.loggerr   r   Z
kivy.utilsr   Zkivy._versionr   r   Z_KIVY_RELEASEr   r   r4   ÚmaxsizeÚrÚcriticalÚversion_infor   r   r   r;   r   r>   r   ÚoptionÚupperÚkeyÚtyper‚   ÚtupleÚsplitrn   r&   r2   Ú	exceptionrS   Ú__name__r9   r   Úgetr   r   Zkivy_binary_deps_dirr	   r
   r   r   r   r   Úexec_prefixrZ   Zexamples_dirre   Z	_packagesrr   rf   Zold_depsÚiter_modulesÚ__path__ÚimporterÚmodnameÚispkgÚ
startswithÚinsertr<   ÚImportErrorrg   Z_logging_msgsÚpackageÚ	find_specZmodule_specÚutilÚmodule_from_specÚmodÚloaderÚexec_moduler)   r`   ÚformatÚeÚstrZ	kivy.depsÚfind_moduleÚload_moduleÚanyrA   Zuser_home_dirZicon_dirÚcopytreeZkivy.configrq   rs   ÚsetLevelZsys_argvÚoptsÚargsÚerrÚerrorÚexitZmp_forkÚoptrm   Z	need_saveÚpidÚsetÚ
ValueErrorÚolÚlenr„   ÚhZkivy.modulesrƒ   Z
usage_listÚopenÚfdÚwriteÚinfoÚ	configureÚremove_sectionÚadd_sectionÚmsgÚ
executabler†   Z
purge_logsr0   r0   r0   r1   Ú<module>   sŠ  	
ÿ3	+ô

ÿÿÿÿ
 û


  ÿÿ  ÿÿ  ÿÿ  ÿÿ












ÿþ            ü



















ÿ





 
 ÿ

