예제 #1
0
파일: groupselector.py 프로젝트: Limsik/e17
    def update(self):
        self._groups = edje.file_collection_list(self.file)
        if self._groups:
            self._groups.sort(key=str.lower)

        self.clear()
        if not self._groups:
            self._selection = ""
            return
        self._groups_items = {}

        for group in self._groups:
            item = self.item_append(group, None, None, self._select, group)
            self._groups_items[group] = item

        # TODO: make a way to let items highlighted but not actually
        # select()-ed, in the sense of selection callbacks

        # item = self._groups_items.get(self._selection)
        # if item:
        #     item.selected_set(True)
        # else:
        #     self._groups_items[self._groups[0]].selected_set(True)

        self.go()
예제 #2
0
파일: editable.py 프로젝트: Limsik/e17
    def group_del(self, grp_name):
        dummy_grp = None
        all_grps = edje.file_collection_list(self._swapfile.workfile)
        for g in all_grps:
            if g != grp_name:
                dummy_grp = g
                break

        if not dummy_grp:
            self.error = "Can not delete the only group in file"
            return False

        if not self.__edje or self._group == grp_name:
            self.group = ""

            dummy_edje = EdjeEdit(
                self._canvas, file=self._swapfile.workfile, group=dummy_grp)
            r = dummy_edje.group_del(grp_name)
            self.error = dummy_edje.error
            dummy_edje.delete()

            return r

        r = self.__edje.group_del(grp_name)
        self.error = self.__edje.error
        return r
예제 #3
0
파일: editable.py 프로젝트: yihan5523/e17
    def group_del(self, grp_name):
        dummy_grp = None
        all_grps = edje.file_collection_list(self._swapfile.workfile)
        for g in all_grps:
            if g != grp_name:
                dummy_grp = g
                break

        if not dummy_grp:
            self.error = "Can not delete the only group in file"
            return False

        if not self.__edje or self._group == grp_name:
            self.group = ""

            dummy_edje = EdjeEdit(self._canvas,
                                  file=self._swapfile.workfile,
                                  group=dummy_grp)
            r = dummy_edje.group_del(grp_name)
            self.error = dummy_edje.error
            dummy_edje.delete()

            return r

        r = self.__edje.group_del(grp_name)
        self.error = self.__edje.error
        return r
예제 #4
0
    def update(self):
        self._groups = edje.file_collection_list(self.file)
        if self._groups:
            self._groups.sort(key=str.lower)

        self.clear()
        if not self._groups:
            self._selection = ""
            return
        self._groups_items = {}

        for group in self._groups:
            item = self.item_append(group, None, None, self._select, group)
            self._groups_items[group] = item

        # TODO: make a way to let items highlighted but not actually
        # select()-ed, in the sense of selection callbacks

        # item = self._groups_items.get(self._selection)
        # if item:
        #     item.selected_set(True)
        # else:
        #     self._groups_items[self._groups[0]].selected_set(True)

        self.go()
예제 #5
0
파일: editable.py 프로젝트: Limsik/e17
    def group_exists(self, grp_name):
        if not self.__edje:
            self.__edje = EdjeEdit(
                self._canvas, file=self._swapfile.workfile,
                group=edje.file_collection_list(self._swapfile.workfile)[0])
            self.event_emit("group.changed", self.group)

        return self.__edje.group_exist(grp_name)
예제 #6
0
파일: editable.py 프로젝트: yihan5523/e17
    def group_exists(self, grp_name):
        if not self.__edje:
            self.__edje = EdjeEdit(self._canvas,
                                   file=self._swapfile.workfile,
                                   group=edje.file_collection_list(
                                       self._swapfile.workfile)[0])
            self.event_emit("group.changed", self.group)

        return self.__edje.group_exist(grp_name)
예제 #7
0
    def test_group_add(self):
        self.assertTrue(self.edj.group_add("new"))
        self.assertFalse(self.edj.group_add("main"))
        self.assertFalse(self.edj.group_add("g1"))
        self.assertFalse(self.edj.group_add("new"))
        new = edje.edit.EdjeEdit(self.canvas.evas, file="test.edj", group="new")
        new.save()
	new.delete()
        self.assertTrue("new" in edje.file_collection_list("test.edj"))
        self.assertTrue(self.edj.group_add("new2"))
        self.assertTrue(self.edj.group_add(""))
예제 #8
0
 def export_get_groups(self):
     return edje.file_collection_list(self._edit_grp.workfile)
예제 #9
0
파일: 02-group.py 프로젝트: yihan5523/e17
 def test_rename(self):
     self.assertFalse(self.group.rename("g1"))
     self.assertTrue(self.group.rename("main"))
     self.assertTrue(self.group.rename("gNewName"))
     self.edj.save()
     self.assertTrue("gNewName" in edje.file_collection_list("test.edj"))
예제 #10
0
파일: editable.py 프로젝트: yihan5523/e17
 def _groups_get(self):
     return edje.file_collection_list(self._swapfile.workfile)
예제 #11
0
파일: editable.py 프로젝트: Limsik/e17
 def _groups_get(self):
     return edje.file_collection_list(self._swapfile.workfile)
예제 #12
0
파일: rpc_handlers.py 프로젝트: Limsik/e17
 def export_get_groups(self):
     return edje.file_collection_list(self._edit_grp.workfile)
예제 #13
0
파일: 02-group.py 프로젝트: Limsik/e17
 def test_rename(self):
     self.assertFalse(self.group.rename("g1"))
     self.assertTrue(self.group.rename("main"))
     self.assertTrue(self.group.rename("gNewName"))
     self.edj.save()
     self.assertTrue("gNewName" in edje.file_collection_list("test.edj"))