def _print_section(self, title, items, indent=1, whitespace=True):
     # Allow a bit of customization of the tabbing
     pad = "\t" * (indent - 1)
     print(pad + title)
     pad += "\t"
     for item in items:
         if len(item) == 2:
             print("%s%s: %s" % (pad, item[0], xstr(item[1])))
         else:
             print("%s%s" % (pad, item[0]))
     if whitespace:
         print ""
Пример #2
0
 def _print_section(self, title, items, indent=1, whitespace=True):
     # Allow a bit of customization of the tabbing
     pad = "\t" * (indent - 1)
     print(pad + title)
     pad += "\t"
     for item in items:
         if len(item) == 2:
             print("%s%s: %s" % (pad, item[0], xstr(item[1])))
         else:
             print("%s%s" % (pad, item[0]))
     if whitespace:
         print("")
Пример #3
0
 def test_xstr(self):
     self.assertEquals("", xstr(None))
     self.assertEquals("1", xstr(1))
     self.assertEquals("JarJar", xstr("JarJar"))
 def test_xstr(self):
     self.assertEqual("", xstr(None))
     self.assertEqual("1", xstr(1))
     self.assertEqual("JarJar", xstr("JarJar"))