Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ÝPfV0ã@s°dZddlmZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl mZmZmZmZmZddgZejeƒZGd d „d eƒZeƒZGd d „d eƒZd d„ZdS)z)Handles all VCS (version control) supporté)Úabsolute_importN)Úparse)Ú BadCommand)Ú display_pathÚ backup_dirÚcall_subprocessÚrmtreeÚask_path_existsÚvcsÚget_src_requirementcs†eZdZiZddddddgZ‡fdd„Zd d „Zed d „ƒZed d„ƒZ edd„ƒZ dd„Z ddd„Z dd„Z dd„Zdd„Z‡ZS)Ú VcsSupportZsshZgitZhgZbzrZsftpZsvncs:tjj|jƒttddƒr(tjj|jƒtt|ƒjƒdS)NÚ uses_fragment) Ú urllib_parseZ uses_netlocÚextendÚschemesÚgetattrr Úsuperr Ú__init__)Úself)Ú __class__©ú/usr/lib/python3.6/__init__.pyrs zVcsSupport.__init__cCs |jjƒS)N)Ú _registryÚ__iter__)rrrrr$szVcsSupport.__iter__cCst|jjƒƒS)N)ÚlistrÚvalues)rrrrÚbackends'szVcsSupport.backendscCsdd„|jDƒS)NcSsg|] }|j‘qSr)Údirname)Ú.0Úbackendrrrú -sz'VcsSupport.dirnames..)r)rrrrÚdirnames+szVcsSupport.dirnamescCs$g}x|jD]}|j|jƒq W|S)N)rrr)rrrrrrÚ all_schemes/s zVcsSupport.all_schemescCsFt|dƒstjd|jƒdS|j|jkrB||j|j<tjd|jƒdS)NÚnamezCannot register VCS %szRegistered VCS backend: %s)ÚhasattrÚloggerÚwarningÚ__name__r#rÚdebug)rÚclsrrrÚregister6s    zVcsSupport.registerNcCs<||jkr|j|=n$||jjƒkr.|j|j=n tjdƒdS)Nz0Cannot unregister because no class or name given)rrr#r%r&)rr)r#rrrÚ unregister>s    zVcsSupport.unregistercCs8x2|jjƒD]$}|j|ƒr tjd||jƒ|jSq WdS)z— Return the name of the version control backend if found at given location, e.g. vcs.get_backend_name('/path/to/vcs/checkout') zDetermine that %s uses VCS: %sN)rrÚcontrols_locationr%r(r#)rÚlocationÚvc_typerrrÚget_backend_nameFs    zVcsSupport.get_backend_namecCs |jƒ}||jkr|j|SdS)N)Úlowerr)rr#rrrÚ get_backendRs zVcsSupport.get_backendcCs|j|ƒ}|r|j|ƒSdS)N)r/r1)rr-r.rrrÚget_backend_from_locationWs  z$VcsSupport.get_backend_from_location)NN)r'Ú __module__Ú __qualname__rrrrÚpropertyrr!r"r*r+r/r1r2Ú __classcell__rr)rrr s      r csÀeZdZdZdZfZd+‡fdd„ Zdd„Zdd„Zd d „Z d d „Z d d„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd,d'd(„Zed)d*„ƒZ‡ZS)-ÚVersionControlÚNcs||_tt|ƒj||ŽdS)N)Úurlrr7r)rr9ÚargsÚkwargs)rrrrgszVersionControl.__init__cCs"tjj|ƒ\}}|jtjjƒp |S)zy posix absolute paths start with os.path.sep, win32 ones start with drive (like c:\folder) )ÚosÚpathÚ splitdriveÚ startswithÚsep)rZrepoZdriveÚtailrrrÚ_is_local_repositoryksz#VersionControl._is_local_repositorycCs |jddƒS)Nú/Ú_)Úreplace)rZsurnamerrrÚtranslate_egg_surnameusz$VersionControl.translate_egg_surnamecCst‚dS)z� Export the repository at the url to the destination location i.e. only download the files, without vcs informations N)ÚNotImplementedError)rr-rrrÚexportyszVersionControl.exportc Csbd}|jjddƒd}tj|ƒ\}}}}}d}d|krF|jddƒ\}}tj||||dfƒ}||fS)zm Returns the correct repository URL and revision by parsing the given repository URL zvSorry, '%s' is a malformed VCS url. The format is +://, e.g. svn+http://myrepo/svn/MyApp#egg=MyAppú+éNú@r8)r9ÚsplitrZurlsplitÚrsplitZ urlunsplit) rZ error_messager9ÚschemeZnetlocr=ZqueryZfragZrevrrrÚ get_url_rev€szVersionControl.get_url_revcCs|j|ƒ|j|ƒfS)zA Returns (url, revision), where both are strings )Úget_urlÚ get_revision)rr-rrrÚget_info“szVersionControl.get_infocCstj|ƒjdƒS)zi Normalize a URL for comparison by unquoting it and removing any trailing slash. rC)rZunquoteÚrstrip)rr9rrrÚ normalize_url›szVersionControl.normalize_urlcCs|j|ƒ|j|ƒkS)zV Compare two repo URLs for identity, ignoring incidental differences. )rT)rZurl1Zurl2rrrÚ compare_urls¢szVersionControl.compare_urlscCst‚dS)zx Called when installing or updating an editable package, takes the source path of the checkout. N)rG)rÚdestrrrÚobtain¨szVersionControl.obtaincCst‚dS)zB Switch the repo at ``dest`` to point to ``URL``. N)rG)rrVr9Ú rev_optionsrrrÚswitch¯szVersionControl.switchcCst‚dS)zO Update an already-existing repo to the given ``rev_options``. N)rG)rrVrXrrrÚupdateµszVersionControl.updatecCst‚dS)zp Return True if the version is identical to what exists and doesn't need to be updated. N)rG)rrVrXrrrÚ check_version»szVersionControl.check_versionc Cs´d}d}tjj|ƒrÔd}tjjtjj||jƒƒr¼|j|ƒ}|j||ƒrœtjd|j j ƒt |ƒ|ƒ|j ||ƒs�tj dt |ƒ|j |ƒ|j||ƒqºtj dƒqÔtjd|j|j t |ƒ|ƒd}ntjd ||j|j ƒd}|�r°tjd|j|ƒtd|d|dƒ}|dk�r2tj d|j t |ƒ||ƒ|j|||ƒn~|d k�r>nr|d k�rftjdt |ƒƒt|ƒd}nJ|d k�rœt|ƒ} tjdt |ƒ| ƒtj|| ƒd}n|dk�r°tjdƒ|S)z­ Prepare a location to receive a checkout/clone. Return True if the location is ready for (and requires) a checkout/clone, False otherwise. TFz)%s in %s exists, and has correct URL (%s)zUpdating %s %s%sz$Skipping because already up-to-date.z%s %s in %s exists with URL %sú%(s)witch, (i)gnore, (w)ipe, (b)ackup ÚsÚiÚwÚbz0Directory %s already exists, and is not a %s %s.ú(i)gnore, (w)ipe, (b)ackup z+The plan is to install the %s repository %szWhat to do? %srrJzSwitching %s %s to %s%sz Deleting %szBacking up %s to %sÚa©r]r^r_r`)r\rc©r^r_r`)rardéÿÿÿÿ)r<r=ÚexistsÚjoinrrPrUr%r(Z repo_nameÚtitlerr[ÚinforZr&r#r rYrrÚshutilZmoveÚsysÚexit) rrVr9rXZ rev_displayZcheckoutÚpromptZ existing_urlZresponseZdest_dirrrrÚcheck_destinationÂs‚             z VersionControl.check_destinationcCs"tjj|ƒrt|ƒ|j|ƒdS)zq Clean up current location and download the url repository (and vcs infos) into location N)r<r=rfrrW)rr-rrrÚunpacks zVersionControl.unpackcCst‚dS)zê Return a string representing the requirement needed to redownload the files currently present in location, something like: {repository_url}@{revision}#egg={project_name}-{version_identifier} N)rG)rÚdistr-rrrr sz"VersionControl.get_src_requirementcCst‚dS)z_ Return the url used at location Used in get_info or check_destination N)rG)rr-rrrrP)szVersionControl.get_urlcCst‚dS)z_ Return the current revision of the files at location Used in get_info N)rG)rr-rrrrQ0szVersionControl.get_revisionTÚraisec Csf|jg|}yt|||||||ƒStk r`}z$|jtjkrNtd|jƒ‚n‚WYdd}~XnXdS)z« Run a VCS subcommand This is simply a wrapper around call_subprocess that adds the VCS command name, and checks that the VCS is available zCannot find command %rN)r#rÚOSErrorÚerrnoÚENOENTr) rÚcmdZ show_stdoutÚcwdZ on_returncodeZ command_descZ extra_environZspinnerÚerrrÚ run_command7s  zVersionControl.run_commandcCs0tjd||j|jƒtjj||jƒ}tjj|ƒS)z¨ Check if a location is controlled by the vcs. It is meant to be overridden to implement smarter detection mechanisms for specific vcs. zChecking in %s for %s (%s)...)r%r(rr#r<r=rgrf)r)r-r=rrrr,Nsz VersionControl.controls_location)N)TNrqNNN)r'r3r4r#rrrrBrFrHrOrRrTrUrWrYrZr[rnror rPrQrxÚ classmethodr,r6rr)rrr7as2 U   r7c CsZtj|ƒ}|rFy|ƒj||ƒStk rDtjd||jƒ|jƒSXtjd|ƒ|jƒS)NzPcannot determine version of editable source in %s (%s command not found in path)ztcannot determine version of editable source in %s (is not SVN checkout, Git clone, Mercurial clone or Bazaar branch))r r2r rr%r&r#Zas_requirement)rpr-Zversion_controlrrrr [s  )Ú__doc__Z __future__rrsZloggingr<rjrkZpip._vendor.six.moves.urllibrrZpip.exceptionsrZ pip.utilsrrrrr Ú__all__Z getLoggerr'r%Úobjectr r r7r rrrrÚs     G{