Exemplo n.º 1
0
 def set_edit_triggers(self, *triggers: EditTriggerStr | None):
     items = ["none" if t is None else t for t in triggers]
     for item in items:
         if item not in EDIT_TRIGGERS:
             raise InvalidParamError(item, EDIT_TRIGGERS)
     flags = helpers.merge_flags(items, EDIT_TRIGGERS)
     self.setEditTriggers(flags)
Exemplo n.º 2
0
 def set_window_flags(self, *flags: constants.WindowFlagStr, append: bool = False):
     for flag in flags:
         if flag not in constants.WINDOW_FLAGS:
             raise InvalidParamError(flag, constants.WINDOW_FLAGS)
     result = helpers.merge_flags(flags, constants.WINDOW_FLAGS)
     if append:
         result = result | self.windowFlags()
     self.setWindowFlags(result)
Exemplo n.º 3
0
    def set_preferred_positioning_methods(self,
                                          *methods: PositioningMethodStr):
        """Set preferred positioning methods.

        Args:
            methods: positioning methods to use

        Raises:
            InvalidParamError: invalid positioning methods
        """
        for item in methods:
            if item not in POSITIONING_METHODS:
                raise InvalidParamError(item, POSITIONING_METHODS)
        flags = helpers.merge_flags(methods, POSITIONING_METHODS)
        self.setPreferredPositioningMethods(flags)
Exemplo n.º 4
0
    def set_text_interaction(self, *types: TextInteractionStr) -> Label:
        """Set the text interaction mode.

        Args:
            types: text interaction mode to use

        Raises:
            InvalidParamError: text interaction mode does not exist
        """
        for item in types:
            if item not in TEXT_INTERACTION:
                raise InvalidParamError(item, TEXT_INTERACTION)
        flags = helpers.merge_flags(types, TEXT_INTERACTION)
        self.setTextInteractionFlags(flags)
        return self
Exemplo n.º 5
0
    def set_font_filters(self, *filters: FontFilterStr):
        """Set font filters.

        Args:
            filters: font filters to use

        Raises:
            InvalidParamError: invalid font filters
        """
        if not filters:
            filters = ("all",)
        for item in filters:
            if item not in FONT_FILTERS:
                raise InvalidParamError(item, FONT_FILTERS)
        flags = helpers.merge_flags(filters, FONT_FILTERS)
        self.setFontFilters(flags)
Exemplo n.º 6
0
 def set_capabilities(self, *capability: CapabilityStr):
     for item in capability:
         if item not in CAPABILITIES:
             raise InvalidParamError(item, CAPABILITIES)
     flags = helpers.merge_flags(capability, CAPABILITIES)
     self.setCapabilities(flags)
Exemplo n.º 7
0
 def set_filter(self, *filters: core.dir.FilterStr):
     for item in filters:
         if item not in core.dir.FILTERS:
             raise InvalidParamError(item, core.dir.FILTERS)
     flags = helpers.merge_flags(filters, core.dir.FILTERS)
     self.setFilter(flags)
Exemplo n.º 8
0
 def set_optimization_flags(self, *items: OptimizationFlagStr):
     for item in items:
         if item not in OPTIMIZATION_FLAGS:
             raise InvalidParamError(item, OPTIMIZATION_FLAGS)
     flags = helpers.merge_flags(items, OPTIMIZATION_FLAGS)
     self.setOptimizationFlags(flags)
Exemplo n.º 9
0
 def set_socket_options(self, *name: SocketOptionStr):
     for item in name:
         if item not in SOCKET_OPTION:
             raise InvalidParamError(item, SOCKET_OPTION)
     flags = helpers.merge_flags(name, SOCKET_OPTION)
     self.setSocketOptions(flags)
Exemplo n.º 10
0
 def set_allowed_areas(self, *areas: constants.ToolbarAreaStr):
     for area in areas:
         if area not in constants.TOOLBAR_AREA:
             raise InvalidParamError(area, constants.TOOLBAR_AREA)
     flag = helpers.merge_flags(areas, constants.TOOLBAR_AREA)
     self.setAllowedAreas(flag)
Exemplo n.º 11
0
 def set_travel_modes(self, *mode: TravelModeStr):
     for item in mode:
         if item not in TRAVEL_MODE:
             raise InvalidParamError(item, TRAVEL_MODE)
     flags = helpers.merge_flags(mode, TRAVEL_MODE)
     self.setTravelModes(flags)