[Checkins] SVN: zope.app.fssync/branches/jim-hack/src/zope/app/fssync/fssync.txt fix whitespace
Fred L. Drake, Jr.
fdrake at gmail.com
Mon Feb 23 11:44:34 EST 2009
Log message for revision 97169:
fix whitespace
Changed:
U zope.app.fssync/branches/jim-hack/src/zope/app/fssync/fssync.txt
-=-
Modified: zope.app.fssync/branches/jim-hack/src/zope/app/fssync/fssync.txt
===================================================================
--- zope.app.fssync/branches/jim-hack/src/zope/app/fssync/fssync.txt 2009-02-23 14:33:44 UTC (rev 97168)
+++ zope.app.fssync/branches/jim-hack/src/zope/app/fssync/fssync.txt 2009-02-23 16:44:34 UTC (rev 97169)
@@ -2,10 +2,10 @@
============
The fssync package allows users to download objects from a Zope3 server
-to the local disk, edit the objects offline and synchronize the
+to the local disk, edit the objects offline and synchronize the
modifications with the server later on.
-Let's start with some basic infrastructure on the server side. We
+Let's start with some basic infrastructure on the server side. We
assume that a folder with some content already exists:
>>> root = getRootFolder()
@@ -30,13 +30,13 @@
Serialization format
--------------------
-On the server side everything must be registered in a manner that we
-are allowed to access the serialized data (see registration.txt for
-details). The serialized content is delivered in a Zope3 specific
+On the server side everything must be registered in a manner that we
+are allowed to access the serialized data (see registration.txt for
+details). The serialized content is delivered in a Zope3 specific
SNARF archive.
-SNARF (Simple New ARchival Format) is a very simple format that
-basically puts one file after another. Here we download it by calling
-the @@toFS.snarf view to give an impression of the internal structure
+SNARF (Simple New ARchival Format) is a very simple format that
+basically puts one file after another. Here we download it by calling
+the @@toFS.snarf view to give an impression of the internal structure
of this format:
>>> headers = {'Authorization':'Basic globalmgr:globalmgrpw'}
@@ -134,22 +134,21 @@
A text file00000017 test/file2.txt
Another text file
-
-Note that the main content is directly serialized whereas extra
+Note that the main content is directly serialized whereas extra
attributes and metadata are pickled in an XML format.
Initial Checkout
----------------
-We perform an initial checkout to see what happens. We mimic the
-command line syntax
+We perform an initial checkout to see what happens. We mimic the
+command line syntax
zsync checkout http://user:password@host:port/path targetdir
-by using the corresponding FSSync command object. (The zsync script
-can be found in this directory. Type ``zsync help`` for a list of
-available commands).
+by using the corresponding FSSync command object. (The zsync script
+can be found in this directory. Type ``zsync help`` for a list of
+available commands).
The FSSync object must be initialized with all relevant connection data.
For the sake of this doctest we need also a special network instance:
@@ -176,11 +175,12 @@
U .../@@Zope/Annotations/test/zope.app.dublincore.ZopeDublinCore
All done.
-The printout shows all new directories and updated files. As you can see,
-the file content is directly mapped onto the filesystem whereas extra data
-and metadata are stored in special @@Zope
+The printout shows all new directories and updated files. As you can see,
+the file content is directly mapped onto the filesystem whereas extra data
+and metadata are stored in special @@Zope
directories.
+
Local Modifications
-------------------
@@ -199,17 +199,17 @@
M .../test/file1.txt
= .../test/file2.txt
-If we want to add a file to the repository we must update the local
+If we want to add a file to the repository we must update the local
list of entries by calling the add command explicitely:
>>> newlocalfile = os.path.join(localdir, 'file3.txt')
>>> fp = open(newlocalfile, 'w')
>>> fp.write('A new local text file')
>>> fp.close()
-
+
>>> zsync.add(newlocalfile)
A .../test/file3.txt
-
+
>>> zsync.status(localdir)
/ .../test/
M .../test/file1.txt
@@ -221,12 +221,12 @@
-----------------------
Before we commit our local modifications we should check whether our
-local repository is still up to date. Let's say that by a coincidence
+local repository is still up to date. Let's say that by a coincidence
someone else edited the same file on the server:
>>> serverfile1.data = 'Ooops'
>>> zope.event.notify(ObjectModifiedEvent(serverfile1))
-
+
>>> zsync.commit(localdir)
Traceback (most recent call last):
...
@@ -234,7 +234,7 @@
test/file1.txt
test/@@Zope/Annotations/file1.txt/zope.app.dublincore.ZopeDublinCore
-We must update the local files and resolve all conflicts before
+We must update the local files and resolve all conflicts before
we can proceed:
>>> zsync.update(localdir)
@@ -261,31 +261,31 @@
Now we can commit our work and have a look at the resulting events:
>>> def traceEvent(event):
- ... print event.__class__.__name__,
+ ... print event.__class__.__name__,
... print getattr(event.object, '__name__', ''),
... descriptions = getattr(event, 'descriptions', None)
... if descriptions is not None:
... for desc in descriptions:
... print desc.__class__.__name__,
... print ''
-
+
>>> zope.event.subscribers.append(traceEvent)
>>> import time
>>> time.sleep(0.1)
>>> zsync.commit(localdir)
- BeforeTraverseEvent None
- BeforeTraverseEvent test
- BeforeTraverseEvent fromFS.snarf
- ObjectModifiedEvent ObjectSynchronized
- ObjectModifiedEvent ObjectSynchronized
- ObjectModifiedEvent file1.txt ObjectSynchronized
- ObjectModifiedEvent ObjectSynchronized
- ObjectModifiedEvent ObjectSynchronized
- ObjectCreatedEvent
- ObjectAddedEvent file3.txt
- ContainerModifiedEvent test
- ObjectModifiedEvent ObjectSynchronized
- EndRequestEvent run
+ BeforeTraverseEvent None
+ BeforeTraverseEvent test
+ BeforeTraverseEvent fromFS.snarf
+ ObjectModifiedEvent ObjectSynchronized
+ ObjectModifiedEvent ObjectSynchronized
+ ObjectModifiedEvent file1.txt ObjectSynchronized
+ ObjectModifiedEvent ObjectSynchronized
+ ObjectModifiedEvent ObjectSynchronized
+ ObjectCreatedEvent
+ ObjectAddedEvent file3.txt
+ ContainerModifiedEvent test
+ ObjectModifiedEvent ObjectSynchronized
+ EndRequestEvent run
U .../test/file1.txt
U .../test/@@Zope/Annotations/file1.txt/zope.app.dublincore.ZopeDublinCore
U .../test/file3.txt
@@ -295,7 +295,6 @@
U .../test/@@Zope/Annotations/file3.txt/zope.app.dublincore.ZopeDublinCore
All done.
-
Let's check whether the server objects have been updated accordingly:
>>> serverfile1.data
@@ -309,7 +308,7 @@
Checkin
-------
-If we want to import (or reimport) the data into a content space
+If we want to import (or reimport) the data into a content space
we can use the checkin command:
>>> del root[u'test']
@@ -317,31 +316,31 @@
ContainerModifiedEvent None
>>> zsync.checkin(localdir)
- BeforeTraverseEvent None
- BeforeTraverseEvent checkin.snarf
- ObjectCreatedEvent None
- ObjectAddedEvent test
- ContainerModifiedEvent None
- ObjectCreatedEvent
- ObjectAddedEvent file1.txt
- ContainerModifiedEvent test
- ObjectModifiedEvent ObjectSynchronized
- ObjectModifiedEvent ObjectSynchronized
- ObjectModifiedEvent file1.txt Attributes
- ObjectCreatedEvent
- ObjectAddedEvent file2.txt
- ContainerModifiedEvent test
- ObjectModifiedEvent ObjectSynchronized
- ObjectModifiedEvent ObjectSynchronized
- ObjectModifiedEvent file2.txt Attributes
- ObjectCreatedEvent
- ObjectAddedEvent file3.txt
- ContainerModifiedEvent test
- ObjectModifiedEvent ObjectSynchronized
- ObjectModifiedEvent ObjectSynchronized
- ObjectModifiedEvent file3.txt Attributes
- ObjectModifiedEvent ObjectSynchronized
- EndRequestEvent run
+ BeforeTraverseEvent None
+ BeforeTraverseEvent checkin.snarf
+ ObjectCreatedEvent None
+ ObjectAddedEvent test
+ ContainerModifiedEvent None
+ ObjectCreatedEvent
+ ObjectAddedEvent file1.txt
+ ContainerModifiedEvent test
+ ObjectModifiedEvent ObjectSynchronized
+ ObjectModifiedEvent ObjectSynchronized
+ ObjectModifiedEvent file1.txt Attributes
+ ObjectCreatedEvent
+ ObjectAddedEvent file2.txt
+ ContainerModifiedEvent test
+ ObjectModifiedEvent ObjectSynchronized
+ ObjectModifiedEvent ObjectSynchronized
+ ObjectModifiedEvent file2.txt Attributes
+ ObjectCreatedEvent
+ ObjectAddedEvent file3.txt
+ ContainerModifiedEvent test
+ ObjectModifiedEvent ObjectSynchronized
+ ObjectModifiedEvent ObjectSynchronized
+ ObjectModifiedEvent file3.txt Attributes
+ ObjectModifiedEvent ObjectSynchronized
+ EndRequestEvent run
>>> serverfolder = root[u'test']
>>> sorted(serverfolder.keys())
@@ -351,8 +350,8 @@
A resolved conflict
>>> serverfile1.getSize() == len(serverfile1.data)
True
-
-We need to make sure that the top-level name doesn't already exist,
+
+We need to make sure that the top-level name doesn't already exist,
or existing data can get screwed:
>>> zsync.checkin(localdir)
@@ -361,9 +360,7 @@
SynchronizationError: object already exists 'test'
-
Clean up
--------
>>> zope.event.subscribers.remove(traceEvent)
-
More information about the Checkins
mailing list