Пример #1
0
 def test_from_list(self):
     baz_man = JSONObject("baz man!")
     lst = [JSONObject("foo"), JSONObject("bar"), baz_man]
     data = JSONObjectDict.from_list(lst)
     self.failUnlessEqual(len(data), len(lst))
     self.failUnless("baz man!" in data)
     self.failUnlessEqual(baz_man, data["baz man!"])
Пример #2
0
 def test_from_list(self):
     baz_man = JSONObject("baz man!")
     lst = [JSONObject("foo"), JSONObject("bar"), baz_man]
     data = JSONObjectDict.from_list(lst)
     self.failUnlessEqual(len(data), len(lst))
     self.failUnless("baz man!" in data)
     self.failUnlessEqual(baz_man, data["baz man!"])
Пример #3
0
 def setUp(self):
     module = self.modules["CustomCommands"]
     globals().update(vars(module))
     self.plugin = self.plugins["CustomCommands"].cls
     config.init()
     self.cmd_list = CustomCommands.DEFAULT_COMS
     self.commands = JSONObjectDict.from_list(self.cmd_list)
 def setUp(self):
     module = self.modules["CustomCommands"]
     globals().update(vars(module))
     self.plugin = self.plugins["CustomCommands"].cls
     config.init()
     self.cmd_list = CustomCommands.DEFAULT_COMS
     self.commands = JSONObjectDict.from_list(self.cmd_list)
Пример #5
0
 def __finish(self, widget):
     # TODO: Warn about impending deletion of nameless items, or something
     all = JSONObjectDict.from_list(
         [row[0] for row in self.model if row[0].name])
     all.save(filename=self.filename)
Пример #6
0
 def __finish(self, widget):
     # TODO: Warn about impending deletion of nameless items, or something
     all = JSONObjectDict.from_list(
             [row[0] for row in self.model if row[0].name])
     all.save(filename=self.filename)
Пример #7
0
 def setUp(self):
     globals().update(vars(self.modules["CustomCommands"]))
     config.init()
     self.cmd_list = CustomCommands.DEFAULT_COMS
     self.commands = JSONObjectDict.from_list(self.cmd_list)
Пример #8
0
 def setUp(self):
     globals().update(vars(self.modules["CustomCommands"]))
     config.init()
     self.cmd_list = CustomCommands.DEFAULT_COMS
     self.commands = JSONObjectDict.from_list(self.cmd_list)