;ς
Ω
PCc @ s d Z d k Z d k Z d k l Z d k l Z d k Z d k l Z d k l
Z
d k Z d k Z d e
f d YZ d e
f d YZ d
f d YZ d e f d
YZ d k l Z e e e e d Z d Z d d Z d Z d Z d S( s2
Utility classes & functions for ZSyncer and UIs.
N( s aq_base( s ClassSecurityInfo( s
DateTimeError( s
html_quotes ZSyncerConfigErrorc B s t Z d Z RS( s? There is a problem with the configuration of this ZSyncer.
( s __name__s
__module__s __doc__( ( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys ZSyncerConfigError s s ZSyncerObjNotFoundc B s t Z d Z RS( s2 ZSyncer could not find an object at the path.
( s __name__s
__module__s __doc__( ( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys ZSyncerObjNotFound s s TextMsgc B s5 t Z d Z d Z d Z d Z d Z d Z RS( s, For logging & output of arbitrary text.
s blackiΘ c C s
| | _ d S( N( s msgs self( s selfs msg( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys __init__+ s c C s t | i Sd S( N( s strs selfs msg( s self( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys __str__. s c C s d | i t | i f Sd S( Ns
%s
( s selfs colors
html_quotes msg( s self( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys html1 s ( s __name__s
__module__s __doc__s colors statuss __init__s __str__s html( ( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys TextMsg# s s StatusMsgc B s, t Z d Z e d Z d Z d Z RS( s1 For logging & output of remote call results.
c C s― t | } t | t o
| i } n | | _ | d j o8 t i | _ | i d o d | } n | | _ n5 t i
| _ d t i i t
| d | f | _ d S( s/ msg may be a text string or a TextMsg.
iΘ s OKs OK: %ss %s: %ss Unknown error!N( s ints statuss
isinstances msgs TextMsgs selfs Configs color_200s colors
startswiths color_errors error_messagess gets str( s selfs msgs statuss context( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys __init__; s
c C s' | i | i j o | i | i j Sd S( N( s others msgs selfs status( s selfs other( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys __eq__M s c C s! d | i i | i | i f Sd S( Ns %s("%s", %s)( s selfs __class__s __name__s msgs status( s self( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys __repr__Q s ( s __name__s
__module__s __doc__s Nones __init__s __eq__s __repr__( ( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys StatusMsg6 s ( s allow_classc C s t | t i o
t n | i } | i d } | o d Sn g } xy | D]q } | i } | d d f j o qV qV | d j o+ y | i
WqΗ t j
o
qV qΗ XqV | i | qV Wd i
| } | o | d d j o d | } n | Sd S( s±
utility function - does basically what os.path.normpath()
does for filesystem paths, but for URLs instead.
Does not verify whether anything exists at the path.
s /s s .s ..i N( s
isinstances urls typess
StringTypes TypeErrors strips splits elementss
norm_elementss es pops
IndexErrors appends joins result( s urls es elementss results
norm_elements( ( s9 /mnt/gmirror/ports/www/zope-zsyncer/work/ZSyncer/utils.pys normalizeRelativeURL` s.
c C sW t | } t | d t d j o&