Ejemplo n.º 1
0
    def updateMirroring(self):
        #print "UPDATE MIRRORING",self.myProposal,self.inControl

        if BlissWidget.isInstanceModeSlave():
            if BlissWidget.isInstanceUserIdUnknown():
                if BlissWidget.isInstanceRoleServer(
                ) and self.inControl is not None and self.inControl[1] is None:
                    BlissWidget.setInstanceMirror(
                        BlissWidget.INSTANCE_MIRROR_ALLOW)
                else:
                    BlissWidget.setInstanceMirror(
                        BlissWidget.INSTANCE_MIRROR_PREVENT)
            elif BlissWidget.isInstanceUserIdInhouse():
                BlissWidget.setInstanceMirror(
                    BlissWidget.INSTANCE_MIRROR_ALLOW)
            else:
                try:
                    control_is_inhouse = self.inControl[1]['inhouse']
                except:
                    control_is_inhouse = False
                if control_is_inhouse or self.inControl[1] is None:
                    BlissWidget.setInstanceMirror(
                        BlissWidget.INSTANCE_MIRROR_ALLOW)
                else:
                    try:
                        my_prop_codes = [
                            self.myProposal['code'], self.myProposal['alias']
                        ]
                    except:
                        my_prop_codes = []
                    try:
                        control_prop_codes = [
                            self.inControl[1]['code'],
                            self.inControl[1]['alias']
                        ]
                    except:
                        control_prop_codes = []
                    mirror = BlissWidget.INSTANCE_MIRROR_PREVENT
                    for code in my_prop_codes:
                        try:
                            control_prop_codes.index(code)
                        except:
                            pass
                        else:
                            mirror = BlissWidget.INSTANCE_MIRROR_ALLOW
                            break
                    for code in control_prop_codes:
                        try:
                            my_prop_codes.index(code)
                        except:
                            pass
                        else:
                            mirror = BlissWidget.INSTANCE_MIRROR_ALLOW
                            break
                    BlissWidget.setInstanceMirror(mirror)
        else:
            BlissWidget.setInstanceMirror(BlissWidget.INSTANCE_MIRROR_PREVENT)
    def updateMirroring(self):
        #print "UPDATE MIRRORING",self.myProposal,self.inControl

        if BlissWidget.isInstanceModeSlave():
            if BlissWidget.isInstanceUserIdUnknown():
                if BlissWidget.isInstanceRoleServer() and self.inControl is not None and self.inControl[1] is None:
                    BlissWidget.setInstanceMirror(BlissWidget.INSTANCE_MIRROR_ALLOW)
                else:
                    BlissWidget.setInstanceMirror(BlissWidget.INSTANCE_MIRROR_PREVENT)
            elif BlissWidget.isInstanceUserIdInhouse():
                BlissWidget.setInstanceMirror(BlissWidget.INSTANCE_MIRROR_ALLOW)
            else:
                try:
                    control_is_inhouse=self.inControl[1]['inhouse']
                except:
                    control_is_inhouse=False
                if control_is_inhouse or self.inControl[1] is None:
                    BlissWidget.setInstanceMirror(BlissWidget.INSTANCE_MIRROR_ALLOW)
                else:
                    try:
                        my_prop_codes=[self.myProposal['code'],self.myProposal['alias']]
                    except:
                        my_prop_codes=[]
                    try:
                        control_prop_codes=[self.inControl[1]['code'],self.inControl[1]['alias']]
                    except:
                        control_prop_codes=[]
                    mirror=BlissWidget.INSTANCE_MIRROR_PREVENT
                    for code in my_prop_codes:
                        try:
                            control_prop_codes.index(code)
                        except:
                            pass
                        else:
                            mirror=BlissWidget.INSTANCE_MIRROR_ALLOW
                            break
                    for code in control_prop_codes:
                        try:
                            my_prop_codes.index(code)
                        except:
                            pass
                        else:
                            mirror=BlissWidget.INSTANCE_MIRROR_ALLOW
                            break
                    BlissWidget.setInstanceMirror(mirror)
        else:
            BlissWidget.setInstanceMirror(BlissWidget.INSTANCE_MIRROR_PREVENT)