https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/south/migration/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/south/migration/base.pyc
�
J:�Tc@s�ddlmZddlmZddlZddlmZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZmZmZmZddlmZddlmZmZmZdd
lmZddl m!Z!m"Z"dd�Z$d�Z%de&fd��YZ'de"e'e(�fd��YZ)de*fd��YZ+dS(i����(tprint_function(tdequeN(treload(tImproperlyConfigured(tmodels(tsettings(t	importlib(t
exceptions(tdependstdfstflattent
get_app_label(tFakeORM(tmemoizetask_for_it_by_nametdatetime_utils(tapp_label_to_app_module(tstring_typestwith_metaclassccs�|dkrtj�}nx_|D]W}dj|jjd�d �}t|�}yt|�VWq"tj	k
rxq"Xq"WdS(sJ
    Returns all Migrations for all `applications` that are migrated.
    t.i����N(
tNoneRtget_appstjoint__name__tsplitRt
MigrationsRtNoMigrations(tapplicationstmodel_moduletapp_pathtapp((s8/usr/lib/python2.7/site-packages/south/migration/base.pytall_migrationss
cCs?t|t�r%|jd�d}n|jjd�d}|S(sNWorks out the app label from either the app label, the app name, or the moduleRi����(t
isinstanceRRR(tapplicationt	app_label((s8/usr/lib/python2.7/site-packages/south/migration/base.pytapplication_to_app_label&stMigrationsMetaclasscBs)eZdZd�Zd�Zd�ZRS(sc
    Metaclass which ensures there is only one instance of a Migrations for
    any given app.
    cCs)tt|�j|||�i|_dS(N(tsuperR$t__init__t	instances(tselftnametbasestdict((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR&6scKsQt|�}||jkrFtt|�jt|�|�|j|<n|j|S(N(R#R'R%R$t__call__R(R(R!tkwdsR"((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR,:s+cCs
i|_dS(s&Clears the cache of Migration objects.N(R'(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt_clear_cacheDs(Rt
__module__t__doc__R&R,R.(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR$/s		
RcBs�eZdZeede�r0ejd�Znejd�Zee	d�Z
e	d�Zd�Zd�Z
d�Zee	d	�Zeee�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zeed��Zed��Zd�ZRS(sA
    Holds a list of Migration objects for a particular app.
    t
SOUTH_USE_PYCs#(?!__init__)[0-9a-zA-Z_]*(\.pyc?)?$s!(?!__init__)[0-9a-zA-Z_]*(\.py)?$cCs i|_|j|||�dS(sOConstructor. Takes the module of the app, NOT its models (like get_app returns)N(t_cachetset_application(R(R!tforce_creationtverbose_creation((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR&Ws	cCs�|j�}tjj|�sE|r5td|�ntj|�ntjj|d�}tjj|�s�|r�td|�nt|d�j	�ndS(sEGiven an application, ensures that the migrations directory is ready.s(Creating migrations directory at '%s'...s__init__.pysCreating __init__.py in '%s'...twN(
tmigrations_dirtostpathtisdirtprinttmkdirRtisfiletopentclose(R(tverboseR7t	init_path((s8/usr/lib/python2.7/site-packages/south/migration/base.pytcreate_migrations_directory\scCs�|j�}ytj|�}Wn�tk
r�y)tjdj|jd�d ��}Wn/tk
r�tjd|jj	d|��q�Xt
jjt
jj|j
�|jd�d�SnXt
jj|j
�SdS(s�
        Returns the full path of the migrations directory.
        If it doesn't exist yet, returns where it would exist, based on the
        app's migrations module (defaults to app.migrations)
        Ri����R!tmoduleN(tmigrations_moduleRt
import_moduletImportErrorRRRtInvalidMigrationModuleR!RR8R9tdirnamet__file__(R(tmodule_pathRCtparent((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR7ls
)
	
3cCs�t|j�}ttd�r;|tjkr;tj|Sn|jjd}ytj|�Wnt	k
rz|jjdSX|SdS(s9Returns the module name of the migrations module for thistSOUTH_MIGRATION_MODULESs.south_migrationss.migrationsN(
R#R!thasattrRRLt_applicationRRRERF(R(R"tmodule_name((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRD�s
cCs|jS(N(RN(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pytget_application�scCs�||_t|d�r�t|d�r�y)tj|j��}||_|_Wq�tk
r�|r�|j|�tj|j��}||_|_q�t	j
|��q�Xnt|d�r�|j|j�n|j|j�dS(s�
        Called when the application for this Migrations is set.
        Imports the migrations module object, and throws a paddy if it can't.
        t
migrationstsouth_migrationsN(
RNRMRRERDt_migrationsRQRFRBRRt_load_migrations_moduleRR(R(R!R4R5RC((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR3�s	 

cs=|�_g}�j�}x�tj|�D]�}�jjtjj|��r+tjj||�}|j	d�r�tjj
|d �r�q+ntjj|�r�tjj
tjj|d��p�tt
dt�o�tjj
tjj|d��s�q+q�n|j|�q+q+W|j��j�fd�|D��dS(Ns.pyci����s__init__.pyR1s__init__.pycc3s|]}�j|�VqdS(N(t	migration(t.0tf(R((s8/usr/lib/python2.7/site-packages/south/migration/base.pys	<genexpr>�s(RSR7R8tlistdirtMIGRATION_FILENAMEtmatchR9tbasenameRtendswithR=R:tgetattrRtFalsetappendtsorttextend(R(RCt	filenamesRHRWt	full_path((R(s8/usr/lib/python2.7/site-packages/south/migration/base.pyRT�s 	%!!	
cCsBtj|�}||jkr7t||�|j|<n|j|S(N(t	Migrationtstrip_filenameR2(R(tfilenameR)((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRU�scCs2t|t�r|j|�Stt|�j|�S(N(R RRUR%Rt__getitem__(R(tvalue((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRg�s
cCs�tj|�}g|D]!}|j�j|�r|^q}t|�dkrW|dSt|�dkr~tj||��ntj|d��dS(Nii(	RdReR)t
startswithtlenRtMultiplePrefixMatchestUnknownMigrationR(R(tprefixtmtmatches((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt_guess_migration�s.cCs?|dks|rdS|dkr+|dS|jd|�SdS(Ntzeroi����Rm(RRp(R(ttarget_name((s8/usr/lib/python2.7/site-packages/south/migration/base.pytguess_migration�s
cCs|jjjd�dS(NRi����(RNRR(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR"�scCs
|jjS(N(RSR(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt	full_name�scCsYt|dt�r|rdSx,t�D]!}x|D]}|j�q4Wq'Wt|_dS(s@Goes through all the migrations, and works out the dependencies.t_dependencies_doneN(R]R^Rtcalculate_dependenciestTrueRu(tclstforceRQRU((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRv�s
cCs3x,t�D]!}x|D]}|j�qWq
WdS(sDGoes through all the migrations, and invalidates all cached modules.N(Rtinvalidate_module(RQRU((s8/usr/lib/python2.7/site-packages/south/migration/base.pytinvalidate_all_modules�s
cCsod}xT|D]L}y2t|j�jd�d�}t||�}Wq
tk
rXq
Xq
Wd|d|fS(sLReturns the fully-formatted filename of what a new migration 'name' would beit_s
%04i_%s.pyi(tintR)Rtmaxt
ValueError(R(R)thighest_numberRUtnumber((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt
next_filename�s

(RR/R0R]RR^tretcompileRYRwR&RBR7RDRPR3tpropertyR!RTRURgRpRsR"RttclassmethodRvtstaticmethodR{R�(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRIs,							
				RdcBsOeZdZd�Zd�Zd�Zd�Zd�Zd�Ze	d��Z
d�Zd	�Zd
�Z
ee
�Z
d�Zd�Zee�Zd
�Zee�Zd�Zee�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zee�Zd�Zee�Zd�ZRS(sE
    Class which represents a particular migration file on-disk.
    cCs.||_||_t�|_t�|_dS(sD
        Returns the migration class implied by 'filename'.
        N(RQRftsettdependenciest
dependents(R(RQRf((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR&s		cCs|j�d|j�S(Nt:(R"R)(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt__str__scCsdt|�S(Ns<Migration: %s>(tstr(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt__repr__scCs.|j�|j�ko-|j�|j�kS(N(R"R)(R(tother((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt__eq__scCstt|��S(N(thashR�(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt__hash__"scCs
|jj�S(N(RQR"(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR"%scCs tjjtjj|��dS(Ni(R8R9tsplitextR[(Rf((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRe(scCs|jtjj|j��S(N(ReR8R9R[Rf(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR),scCs|jj�d|j�S(NR(RQRtR)(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRt/scCs�|j�}ytj|}Wn�tk
r�yt|iidg�}Wq�tk
rv}tj|tj���q�t	k
r�}tj
|tj���q�XnXd�|_t|_
|S(s)Tries to load the actual migration moduleRdcSs|S(N((tx((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt<lambda>?s(RttsystmodulestKeyErrort
__import__RFRRltexc_infot	ExceptiontBrokenMigrationR|Rtdatetime(R(RtRUte((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRU2s
 	cCs
|j�jS(s+Returns the Migration class from the module(RURd(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pytmigration_classDscCs
|j��S(s Instantiates the migration_class(R�(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pytmigration_instanceHscCs1|jj|�d}|dkr&dS|j|S(sAReturns the migration that comes before this one in the sequence.iiN(RQtindexR(R(R�((s8/usr/lib/python2.7/site-packages/south/migration/base.pytpreviousMscCs:|jj|�d}|t|j�kr/dS|j|S(s@Returns the migration that comes after this one in the sequence.iN(RQR�RjR(R(R�((s8/usr/lib/python2.7/site-packages/south/migration/base.pytnextUsccs�x�t|j�|g�D]�\}}yt|�}Wn#tk
rZtj||��nX|j|�}y|j�Wn&tjk
r�tj||��nX|j	|�t
kr�tj||��n|VqWdS(s�
        Given the name of an attribute (depends_on or needed_by), either yields
        a list of migration objects representing it, or errors out.
        N(R]R�RRRtDependsOnUnmigratedApplicationRURltDependsOnUnknownMigrationt	is_beforeR^tDependsOnHigherMigration(R(tattrnameRR)RQRU((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt_get_dependency_objects]s%
cCs�x7|jd�D]&}|jj|�|jj|�qWx7|jd�D]&}|jj|�|jj|�qJW|j�}|r�|jj|�|jj|�ndS(s~
        Loads dependency info for this migration, and stores it in itself
        and any other relevant migrations.
        t
depends_ont	needed_byN(R�R�taddR�R�(R(RUR�((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRvpscCs!t|j��|jj�dS(s�
        Removes the cached version of this migration's module import, so we
        have to re-import it. Used when south.db.db changes.
        N(RRUt_invalidate(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRz�scCs
|j�jS(N(R�tforwards(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR��scCs
|j�jS(N(R�t	backwards(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR��scCst|d��S(s�
        Returns a list of Migration objects to be applied, in order.

        This list includes `self`, which will be applied last.
        cSs|jS(N(R�(R�((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR��s(R(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt
forwards_plan�scCst|d��S(NcSs|jS(N(R�(R�((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR��s(R(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt_backwards_plan�scCst|j��S(s�
        Returns a list of Migration objects to be unapplied, in order.

        This list includes `self`, which will be unapplied last.
        (tlistR�(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pytbackwards_plan�scCs0|j|jkr,|j|jkr(tStSdS(N(RQRfRwR^(R(R�((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR��scCs0|j|jkr,|j|jkr(tStSdS(N(RQRfRwR^(R(R�((s8/usr/lib/python2.7/site-packages/south/migration/base.pytis_after�scCsWt|j�dt�r"|j�S|j�}|dkrMtd|j��S|j�S(Ntsymmetrical(R]R�R^tormR�RRR"(R(R�((s8/usr/lib/python2.7/site-packages/south/migration/base.pytprev_orm�s
cCst|j�|j��S(N(RR�R"(R(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR��scCs0|j�}y|jSWntk
r+tSXdS(N(R�t
no_dry_runtAttributeErrorR^(R(R�((s8/usr/lib/python2.7/site-packages/south/migration/base.pyR��s

( RR/R0R&R�R�R�R�R"R�ReR)RtRUR
R�R�R�R�R�RvRzR�R�R�R�R�R�R�R�R�R�(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyRd
sD																										(,t
__future__RtcollectionsRR�timpRR8R�R�tdjango.core.exceptionsRt	django.dbRtdjango.confRtdjango.utilsRtsouthRtsouth.migration.utilsRR	R
Rt	south.ormRtsouth.utilsR
RRRtsouth.utils.py3RRRRR#ttypeR$R�RtobjectRd(((s8/usr/lib/python2.7/site-packages/south/migration/base.pyt<module>s*"		�

https://t.me/AnonymousX5 - 2025