[Commits] (morgen) Added a method which checks for any active shares
commits at osafoundation.org
commits at osafoundation.org
Wed Feb 2 10:15:25 PST 2005
Commit by: morgen
Modified files:
chandler/parcels/osaf/framework/sharing/Sharing.py 1.54 1.55
Log message:
Added a method which checks for any active shares
ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/sharing/Sharing.py.diff?r1=text&tr1=1.54&r2=text&tr2=1.55
Index: chandler/parcels/osaf/framework/sharing/Sharing.py
diff -u chandler/parcels/osaf/framework/sharing/Sharing.py:1.54 chandler/parcels/osaf/framework/sharing/Sharing.py:1.55
--- chandler/parcels/osaf/framework/sharing/Sharing.py:1.54 Wed Feb 2 10:05:40 2005
+++ chandler/parcels/osaf/framework/sharing/Sharing.py Wed Feb 2 10:15:24 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.54 $"
-__date__ = "$Date: 2005/02/02 18:05:40 $"
+__version__ = "$Revision: 1.55 $"
+__date__ = "$Date: 2005/02/02 18:15:24 $"
__copyright__ = "Copyright (c) 2004 Open Source Applications Foundation"
__license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
@@ -1540,3 +1540,17 @@
if share.active:
share.sync()
+
+def checkForActiveShares(view):
+ """ See if there are any non-hidden, active shares.
+
+ @param view: The repository view object
+ @type view: L{repository.persistence.RepositoryView}
+ @return: True if there are non-hidden, active shares; False otherwise
+ """
+
+ shareKind = view.findPath("//parcels/osaf/framework/sharing/Share")
+ for share in KindQuery().run([shareKind]):
+ if share.active and not share.hidden:
+ return True
+ return False
More information about the Commits
mailing list