def __init__(self, controller):
        self._delete_confirmed = False
        self._delete_usage = False
        self._controller = controller
        title = 'Delete resource'
        checkbox_label = 'Also delete resource imports'

        usages = list(controller.execute(FindResourceUsages()))
        self._delete_confirmed, self._delete_usage = _UsageDialog(
            usages, title, checkbox_label).show()
    def __init__(self, controller):
        self._rename_confirmed = True
        self._rename_usage = False
        title = 'Rename resource'
        checkbox_label = 'Also update resource imports'

        usages = list(controller.execute(FindResourceUsages()))
        if usages:
            self._rename_confirmed, self._rename_usage = _UsageDialog(
                usages, title, checkbox_label).show()
示例#3
0
 def _find_usages(self):
     return self._controller.execute(FindResourceUsages())
 def test_import_in_resource_file(self):
     inner_resu = self.resu.imports[0].get_imported_controller()
     usages = list(inner_resu.execute(FindResourceUsages()))
     self._verify_length(1, usages)
     self._verify_that_contains(self.resu, usages)
 def test_resource_usages_finding(self):
     usages = list(self.resu.execute(FindResourceUsages()))
     self._verify_length(2, usages)
     self._verify_that_contains(self.ts1, usages)
     self._verify_that_contains(self.ts2, usages)