³ò
ZíýIc           @   s~  d  Z  d d k Z d d k Z d d k l Z e d j o?e i d Z e d e i ƒ Z	 e	 d j o
 e Z	 n e i
 i e	 ƒ p d Ge	 GHe i ƒ  n e d	 e i ƒ Z e d j o e	 e j o
 d
 Z qÕ n e d j o d GHe i ƒ  n e i
 i e ƒ p& e i d Z e i
 i e e ƒ Z n e i
 i e ƒ p d Ge GHe i ƒ  n e	 e j o d GHe i ƒ  n d Ge	 Gd Ge Gd GHd Z e d e i ƒ Z e d j o e i e	 ƒ Z n e i d ƒ Z e d e i ƒ Z e i d ƒ Z xy e D]q Z e i e ƒ d j oU e i
 i e	 e ƒ Z e i
 i e ƒ o) e GHe i e e d e ƒ i ƒ  GHqmqüqüWd GHn d S(   s<  
#+
# NAME:
#	rsync_loc
# PURPOSE:
#	Python script to synchronize a master directory with a 
#	local copy accessible through anonymous ftp.
# INPUTS:
#	Content of <source>
# OPTIONAL INPUT ARGUMENTS:
#	source=<source>			default: $SMEI
#		source directory to be mirrored to <source>
#	destination=<destination>	default: loc_smei' (only if $SMEI is source)
#		name of destination subdirectory in the root directory
#		of the oftp server.
#	include=<include>		default: all subdirectories in <source>
#		comma-separated list of subdirectories in <source> to be mirrored.
#		Entries in this list are appended to <destination> and tested for
#		existence.
#	exclude=<exclude>		default: none
#		comma-separated list of subdirectories in <source> to be excluded.
#		Entries in this list are appended to <source> and tested for
#		existence.
# CALLS:
#	clean_loc_smei, tiny.start
# PROCEDURE:
#	If the include and exclude arguments are not used (i.e. everything in
#	<source> is mirrored than calling rsync_loc is essentially the same as
#	executing rsync directly as:
#
#	rsync --archive --delete --verbose <source> <parent of <destination>> 
# MODIFICATION HISTORY:
#	JAN-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
#		More generic replacement of rsync_ssw allowing for exclusion
#		and/or inclusion of subdirectories in the source directory.
#-
iÿÿÿÿN(   t   startt   __main__t   SMEIs   source=t    s%   Source is not an existing directory: s   destination=t   loc_smeis   No destination specifiedt   FTP_ANONs*   Destination is not an existing directory: s$   Source and destination are identicals   
s    ---> s#   rsync --archive --verbose --delete s   include=t   ,s   exclude=i    t    t   done(   t   __doc__t   ost   syst   tinyR    t   __name__t   environt   smeit   argvt   sourcet   patht   isdirt   exitt   destinationt   ftproott   joint   rsynct   inclst   listdirt   splitt   exclst   inclt   countt   incldirt   popent   read(    (    (    s   rsync_loc.pys   <module>&   sT   
		 ,