fixing up some whitespace issues
authorJosh Karlin <jkarlin@bbn.com>
Tue, 25 May 2010 17:57:34 +0000 (17:57 +0000)
committerJosh Karlin <jkarlin@bbn.com>
Tue, 25 May 2010 17:57:34 +0000 (17:57 +0000)
sfa/trust/rights.py
xmlbuilder-0.9/xmlbuilder.egg-info/PKG-INFO

index 5e826ea..cb34f31 100644 (file)
@@ -19,7 +19,7 @@
 privilege_table = {"authority": ["register", "remove", "update", "resolve", "list", "listresources", "getcredential", "*"],
                    "refresh": ["remove", "update"],
                    "resolve": ["resolve", "list", "listresources", "getcredential", "getversion"],
-                   "sa": ["getticket", "redeemslice", "redeemticket", "createslice", "createsliver", "deleteslice", "deletesliver", "updateslice",  
+                   "sa": ["getticket", "redeemslice", "redeemticket", "createslice", "createsliver", "deleteslice", "deletesliver", "updateslice",
                           "getsliceresources", "getticket", "loanresources", "stopslice", "startslice", "renewsliver",
                           "deleteslice", "deletesliver", "resetslice", "listslices", "listnodes", "getpolicy", "sliverstatus"],
                    "embed": ["getticket", "redeemslice", "redeemticket", "createslice", "createsliver", "renewsliver", "deleteslice", "deletesliver", "updateslice", "sliverstatus", "getsliceresources", "shutdown"],
@@ -79,54 +79,54 @@ def determine_rights(type, name):
 
 
 class Right:
-   ##
-   # Create a new right.
-   #
-   # @param kind is a string naming the right. For example "control"
-
-   def __init__(self, kind, delegate=False):
-      self.kind = kind
-      self.delegate = delegate
-      
-   ##
-   # Test to see if this right object is allowed to perform an operation.
-   # Returns True if the operation is allowed, False otherwise.
-   #
-   # @param op_name is a string naming the operation. For example "listslices".
-
-   def can_perform(self, op_name):
-      allowed_ops = privilege_table.get(self.kind.lower(), None)
-      if not allowed_ops:
-         return False
-
-      # if "*" is specified, then all ops are permitted
-      if "*" in allowed_ops:
-         return True
-
-      return (op_name.lower() in allowed_ops)
-
-   ##
-   # Test to see if this right is a superset of a child right. A right is a
-   # superset if every operating that is allowed by the child is also allowed
-   # by this object.
-   #
-   # @param child is a Right object describing the child right
-
-   def is_superset(self, child):
-      my_allowed_ops = privilege_table.get(self.kind.lower(), None)
-      child_allowed_ops = privilege_table.get(child.kind.lower(), None)
-
-      if not self.delegate:
-          return False
-
-      if "*" in my_allowed_ops:
-          return True
-
-      for right in child_allowed_ops:
-          if not right in my_allowed_ops:
-              return False
-
-      return True
+    ##
+    # Create a new right.
+    #
+    # @param kind is a string naming the right. For example "control"
+
+    def __init__(self, kind, delegate=False):
+        self.kind = kind
+        self.delegate = delegate
+
+    ##
+    # Test to see if this right object is allowed to perform an operation.
+    # Returns True if the operation is allowed, False otherwise.
+    #
+    # @param op_name is a string naming the operation. For example "listslices".
+
+    def can_perform(self, op_name):
+        allowed_ops = privilege_table.get(self.kind.lower(), None)
+        if not allowed_ops:
+            return False
+
+        # if "*" is specified, then all ops are permitted
+        if "*" in allowed_ops:
+            return True
+
+        return (op_name.lower() in allowed_ops)
+
+    ##
+    # Test to see if this right is a superset of a child right. A right is a
+    # superset if every operating that is allowed by the child is also allowed
+    # by this object.
+    #
+    # @param child is a Right object describing the child right
+
+    def is_superset(self, child):
+        my_allowed_ops = privilege_table.get(self.kind.lower(), None)
+        child_allowed_ops = privilege_table.get(child.kind.lower(), None)
+
+        if not self.delegate:
+            return False
+
+        if "*" in my_allowed_ops:
+            return True
+
+        for right in child_allowed_ops:
+            if not right in my_allowed_ops:
+                return False
+
+        return True
 
 ##
 # A RightList object represents a list of privileges.
@@ -180,7 +180,7 @@ class RightList:
     # Save the rightlist object to a string. It is saved in the format of a
     # comma-separated list.
 
-    def save_to_string(self):        
+    def save_to_string(self):
         right_names = []
         for right in self.rights:
             right_names.append('%s:%d' % (right.kind.strip(), right.delegate))
index d62ca7c..bb65a9d 100644 (file)
@@ -7,74 +7,74 @@ Author: koder
 Author-email: koder_dot_mail@gmail_dot_com
 License: MIT
 Download-URL: http://pypi.python.org/pypi/xmlbuilder
-Description: Example of usage:\r
-        -----------------\r
-        \r
-        \r
-        from __future__ import with_statement\r
-        from xmlbuilder import XMLBuilder\r
-        x = XMLBuilder(format=True)\r
-        with x.root(a = 1):\r
-            with x.data:\r
-                [x &lt;&lt; ('node',{'val':i}) for i in range(10)]\r
-        \r
-        print str(x)\r
-        \r
-        will print\r
-        \r
-        &lt;root a="1"&gt;\r
-            &lt;data&gt;\r
-                &lt;node val="0" /&gt;\r
-                &lt;node val="1" /&gt;\r
-                &lt;node val="2" /&gt;\r
-                &lt;node val="3" /&gt;\r
-                &lt;node val="4" /&gt;\r
-                &lt;node val="5" /&gt;\r
-                &lt;node val="6" /&gt;\r
-                &lt;node val="7" /&gt;\r
-                &lt;node val="8" /&gt;\r
-                &lt;node val="9" /&gt;\r
-            &lt;/data&gt;\r
-        &lt;/root&gt;\r
-        \r
-        Mercurial repo:http://hg.assembla.com/MyPackages/\r
-        \r
-        Documentations\r
-        --------------\r
-        `XMLBuilder` is simple library build on top of `ElementTree.TreeBuilder` to\r
-        simplify xml files creation as much as possible. Althow it can produce\r
-        structured result with identated child tags. `XMLBuilder` use python `with`\r
-        statement to define xml tag levels and `&lt;&lt;` operator for simple cases -\r
-        text and tag without childs.\r
-        \r
-        First we need to create xmlbuilder\r
-        \r
-            from xmlbuilder import XMLBuilder\r
-            # params - encoding = 'utf8',\r
-            # builder = None, - ElementTree.TreeBuilder \r
-            # tab_level = None, - current tab l;evel - for formatted output only\r
-            # format = False, - create formatted output\r
-            # tab_step = " " * 4 - indentation step\r
-            xml = XMLBuilder()\r
-        \r
-        \r
-        Use `with` statement to make document structure\r
-            #create and open tag 'root_tag' with text 'text' and attributes\r
-            with xml.root_tag(text,attr1=val1,attr2=val2):\r
-                #create and open tag 'sub_tag'\r
-                with xml.sub_tag(text,attr3=val3):\r
-                    #create tag which are not valid python identificator\r
-                    with xml('one-more-sub-tag',attr7=val37):\r
-                        xml &lt;&lt; "Some textual data"\r
-                    #here tag 'one-more-sub-tag' are closed\r
-                               #Tags without children can be created using `&lt;&lt;` operator\r
-                    for val in range(15):\r
-                        xml &lt;&lt; ('message',"python rocks!"[:i])\r
-                    #create 15 child tag like &lt;message&gt; python r&lt;/message&gt;\r
-            #all tags closed\r
-            node = ~x # get etree.ElementTree object\r
-            xml_data = str(x)\r
-            unicode_xml_data = unicode(x)\r
+Description: Example of usage:
+        -----------------
+        
+        
+        from __future__ import with_statement
+        from xmlbuilder import XMLBuilder
+        x = XMLBuilder(format=True)
+        with x.root(a = 1):
+        with x.data:
+        [x &lt;&lt; ('node',{'val':i}) for i in range(10)]
+        
+        print str(x)
+        
+        will print
+        
+        &lt;root a="1"&gt;
+        &lt;data&gt;
+        &lt;node val="0" /&gt;
+        &lt;node val="1" /&gt;
+        &lt;node val="2" /&gt;
+        &lt;node val="3" /&gt;
+        &lt;node val="4" /&gt;
+        &lt;node val="5" /&gt;
+        &lt;node val="6" /&gt;
+        &lt;node val="7" /&gt;
+        &lt;node val="8" /&gt;
+        &lt;node val="9" /&gt;
+        &lt;/data&gt;
+        &lt;/root&gt;
+        
+        Mercurial repo:http://hg.assembla.com/MyPackages/
+        
+        Documentations
+        --------------
+        `XMLBuilder` is simple library build on top of `ElementTree.TreeBuilder` to
+        simplify xml files creation as much as possible. Althow it can produce
+        structured result with identated child tags. `XMLBuilder` use python `with`
+        statement to define xml tag levels and `&lt;&lt;` operator for simple cases -
+        text and tag without childs.
+        
+        First we need to create xmlbuilder
+        
+        from xmlbuilder import XMLBuilder
+        # params - encoding = 'utf8',
+        # builder = None, - ElementTree.TreeBuilder
+        # tab_level = None, - current tab l;evel - for formatted output only
+        # format = False, - create formatted output
+        # tab_step = " " * 4 - indentation step
+        xml = XMLBuilder()
+        
+        
+        Use `with` statement to make document structure
+        #create and open tag 'root_tag' with text 'text' and attributes
+        with xml.root_tag(text,attr1=val1,attr2=val2):
+        #create and open tag 'sub_tag'
+        with xml.sub_tag(text,attr3=val3):
+        #create tag which are not valid python identificator
+        with xml('one-more-sub-tag',attr7=val37):
+        xml &lt;&lt; "Some textual data"
+        #here tag 'one-more-sub-tag' are closed
+        #Tags without children can be created using `&lt;&lt;` operator
+        for val in range(15):
+        xml &lt;&lt; ('message',"python rocks!"[:i])
+        #create 15 child tag like &lt;message&gt; python r&lt;/message&gt;
+        #all tags closed
+        node = ~x # get etree.ElementTree object
+        xml_data = str(x)
+        unicode_xml_data = unicode(x)
         
 Keywords: xml
 Platform: UNKNOWN