예제 #1
0
 def doc(self, value):
     if value is None:
         self._doc = Doc()
     elif isinstance(value, basestring):
         self._doc = Doc.get_from_str(value)
     elif isinstance(value, Doc):
         self._doc = value
     else:
         raise TypeError(
             "Received bad type %s for doc, expected type %s or string" %
             (type(value), Doc))
예제 #2
0
파일: command.py 프로젝트: AllanY/atk
 def doc(self, value):
     if value is None:
         self._doc = Doc()
     elif isinstance(value, basestring):
         self._doc = Doc.get_from_str(value)
     elif isinstance(value, Doc):
         self._doc = value
     else:
         raise TypeError("Received bad type %s for doc, expected type %s or string" % (type(value), Doc))
예제 #3
0
파일: pyrst.py 프로젝트: kkasravi/atk
 def doc_to_rst(doc):
     """Create a Doc object if not already a Doc"""
     return doc if isinstance(doc, Doc) else Doc.get_from_str(doc)
예제 #4
0
 def doc_to_rst(doc):
     """Create a Doc object if not already a Doc"""
     return doc if isinstance(doc, Doc) else Doc.get_from_str(doc)
예제 #5
0
파일: test_genrst.py 프로젝트: kkasravi/atk
    def test_get_from_str(self):
        d = Doc.get_from_str(self.doc1)
        self.assertEqual("Computes a cumulative percent sum.", d.one_line)
        self.assertEqual("""A cumulative percent sum is computed by sequentially stepping through the
column values and keeping track of the current percentage of the total sum
accounted for at the current value.""", d.extended)