Files
old-saburly-wagtail-web/env/lib/python3.10/site-packages/wagtail/__pycache__/locks.cpython-310.pyc

65 lines
8.0 KiB
Plaintext
Raw Normal View History

2024-08-27 20:33:44 +02:00
o
<00><><EFBFBD>fo&<00>@s<>ddlmZddlmZddlmZddlmZddlm Z
ddl m Z m Z ddlmZGdd <09>d <09>ZGd
d <0B>d e<10>ZGd d <0A>d e<10>ZGdd<0F>de<10>ZdS)<11>)<01>settings)<01> format_html)<01> mark_safe)<01>capfirst)<01>gettext)<02>get_latest_str<74>get_user_display_name)<01>render_timestampc@sJeZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Zd d <0A>Z ddd<10>Z
dS)<12>BaseLockzv
Holds information about a lock on an object.
Returned by LockableMixin.get_lock() (or Page.get_lock()).
cCs6ddlm}||_t||<02>|_|jr|n|jj|_dS)Nr)<01>Page)<08>wagtail.modelsr <00>object<63>
isinstance<EFBFBD>is_page<67>_meta<74> verbose_name<6D>
model_name)<03>selfr r <00>r<00>O/home/amir/Desktop/saburlyweb/env/lib/python3.10/site-packages/wagtail/locks.py<70>__init__s  zBaseLock.__init__cCstS)zE
Returns True if the lock applies to the given user.
)<01>NotImplemented<65>r<00>userrrr<00>for_user<00>zBaseLock.for_usercC<00>dS)zU
Returns a message to display to the given user describing the lock.
Nrrrrr<00> get_message rzBaseLock.get_messagecCr)zC
Returns the name of the icon to use for the lock.
<20>lockrrrrr<00>get_icon&rzBaseLock.get_iconcC<00>td<01>S)z`
Returns a string that represents the user or mechanism that locked the object.
<20>Locked<65><01>_rrrr<00> get_locked_by,szBaseLock.get_locked_bycCsttd<01>d|ji<00>S)zQ
Returns a description of the lock to display to the given user.
z:No one can make changes while the %(model_name)s is lockedr<00>rr#rrrrr<00>get_description2s
<02><04>zBaseLock.get_descriptionNcCs.|<00>|<01>|<00>|<01>|<00>|<01>|<00>|<01>|<00>|<01>d<01>S)zV
Returns a context dictionary to use in templates for the given user.
)<05>locked<65>message<67>icon<6F> locked_by<62> description)rrrr$r&)rr<00>parent_contextrrr<00>get_context_for_user;s <06>zBaseLock.get_context_for_user<65>N) <0B>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rrrrr$r&r-rrrrr
s r
cs<eZdZdZdd<03>Zdd<05>Z<05>fdd<07>Z<06>fdd <09>Z<07>ZS)
<EFBFBD> BasicLockz<6B>
A lock that is enabled when the "locked" attribute of an object is True.
The object may be editable by a user depending on whether the locked_by field is set
and if WAGTAILADMIN_GLOBAL_EDIT_LOCK is not set to True.
cCsttdd<00>}|p|j|jjkS)N<>WAGTAILADMIN_GLOBAL_EDIT_LOCK)<05>getattrr<00>pkr <00> locked_by_id)rr<00>global_edit_lockrrrrPs zBasicLock.for_usercCs<>t|j<01>}|jj|jkr%|jjrttd<01>|t|jj<04>d<02>Sttd<03>|d<04>S|jjr?|jjr?ttd<05>|t |jj<08>t|jj<04>d<06>Sttd<07>|d<04>S)Nz?<b>'{title}' was locked</b> by <b>you</b> on <b>{datetime}</b>.)<02>title<6C>datetimez)<b>'{title}' is locked</b> by <b>you</b>.)r9zB<b>'{title}' was locked</b> by <b>{user}</b> on <b>{datetime}</b>.)r9rr:z<b>'{title}' is locked</b>.)
rr r7r6<00> locked_atrr#r r*r)rrr9rrrrTs6
<02>
<06>
<06><02>

<06> <06>zBasicLock.get_messagecs2|jj|jkr td<01>S|jjrtd<02>St<04><00>|<01>S)Nz Locked by youzLocked by another user)r r7r6r#<00>superr$r<00><01> __class__rrr${s
 zBasicLock.get_locked_bycsX|jj|jkrttd<01>d|ji<00>S|jjr&ttd<03>t|jj<07>|jd<04><00>St<08><00> |<01>S)Nz<Only you can make changes while the %(model_name)s is lockedrzAOnly %(user)s can make changes while the %(model_name)s is locked)rr)
r r7r6rr#rrr*r<r&rr=rrr&<00>s<02><04>
<04><02><04> zBasicLock.get_description) r/r0r1r2rrr$r&<00> __classcell__rrr=rr3Hs  'r3cs`eZdZdZ<03>fdd<03>Zdd<05>Zdd<07>Zd<12>fd d
<EFBFBD> Zdd d <0C>Zdd d<0E>Z d<13>fdd<11> Z
<EFBFBD>Z S)<14> WorkflowLockzi
A lock that requires the user to pass the Task.locked_for_user test on the given workflow task.
cst<00><00>|<01>||_dSr.)r<r<00>task)rr rAr=rrr<00>s 
zWorkflowLock.__init__cCs|j<00>|j|<01>Sr.)rA<00>locked_for_userr rrrrr<00>szWorkflowLock.for_usercCs<>|<00>|<01>rG|jj}|rt|<02><04><00>dkrttd<02>d|ji<00>}nttd<04>|j|j j
|j j
d<05>}t t|<03><01>}ttd<06>d|ji<00>}t |d|<00>SdS)N<>z5This %(model_name)s is currently awaiting moderation.rz\This {model_name} is awaiting <b>'{task_name}'</b> in the <b>'{workflow_name}'</b> workflow.)r<00> task_name<6D> workflow_namez9Only reviewers for this task can edit the %(model_name)s.<2E> ) rr <00>current_workflow_state<74>len<65>all_tasks_with_statusrr#rrrA<00>name<6D>workflowr)rrrG<00> workflow_info<66>reviewers_inforrrr<00>s4
<02><02><06><02><06> <02><04><04>zWorkflowLock.get_messageFcs|rdSt<00><00>|<01>S)Nz lock-open)r<r<00>rr<00>can_lockr=rrr<00>s zWorkflowLock.get_iconcCs|rtd<01>Std<02>S)N<>UnlockedzLocked by workflowr"rNrrrr$<00>szWorkflowLock.get_locked_bycCs0|r ttd<01>d|ji<00>Sttd<03>d|ji<00>S)NuZReviewers can edit this %(model_name)s lock it to prevent other reviewers from editingrz6Only reviewers can edit and approve the %(model_name)sr%rNrrrr&<00>s<02><02><04><02><04>zWorkflowLock.get_descriptionNcsTt<00><00>||<02>}|r(d|vr(|<02>dd<02>}|<03>|<00>||<04>|<00>||<04>|<00>||<04>d<03><03>|S)N<> user_can_lockF)r)r*r+)r<r-<00>get<65>updaterr$r&)rrr,<00>contextrOr=rrr-<00>s  


<04><04>z!WorkflowLock.get_context_for_user)Fr.) r/r0r1r2rrrrr$r&r-r?rrr=rr@<00>s !

 r@c@s0eZdZdZdd<03>Zdd<05>Zdd<07>Zdd <09>Zd
S) <0B>ScheduledForPublishLockz<6B>
A lock that occurs when something is scheduled to be published.
This prevents it becoming difficult for users to see which version is going to be published.
Nobody can edit something that's scheduled for publish.
cCr)NTrrrrrr<00>sz ScheduledForPublishLock.for_usercCs2|jj}ttd<01>|j|jt|j<07>d<02>}tt |<03><01>S)NzP{model_name} '{title}' is locked and has been scheduled to go live at {datetime})rr9r:)
r <00>scheduled_revisionrr#r<00>
object_strr <00>approved_go_live_atrr)rrrVr(rrrr<00>s<02><06> z#ScheduledForPublishLock.get_messagecCr )NzLocked by scheduler"rrrrr$<00>z%ScheduledForPublishLock.get_locked_bycCr )Nz7Currently locked and will go live on the scheduled dater"rrrrr&rYz'ScheduledForPublishLock.get_descriptionN)r/r0r1r2rrr$r&rrrrrU<00>s  rUN)<14> django.confr<00>django.utils.htmlr<00>django.utils.safestringr<00>django.utils.textr<00>django.utils.translationrr#<00>wagtail.admin.utilsrr<00>wagtail.utils.timestampsr r
r3r@rUrrrr<00><module>s     =KW