当前位置: 首页>>代码示例>>Python>>正文


Python Common.modify_color方法代码示例

本文整理汇总了Python中pyasm.common.Common.modify_color方法的典型用法代码示例。如果您正苦于以下问题:Python Common.modify_color方法的具体用法?Python Common.modify_color怎么用?Python Common.modify_color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyasm.common.Common的用法示例。


在下文中一共展示了Common.modify_color方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_color

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import modify_color [as 别名]
 def get_color(my):
     color = Xml.get_attribute( my.node, "color" )
     from pyasm.web import Palette
     theme = Palette.get().get_theme()
     if theme == 'dark':
         color = Common.modify_color(color, -50)
     return color
开发者ID:funic,项目名称:TACTIC,代码行数:9,代码来源:pipeline.py

示例2: color

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import modify_color [as 别名]
    def color(my, category, modifier=0, default=None):

        if not category:
            category = 'background'


        # make default adjustments
        if category.startswith("#"):
            color = category
            category = "color"
        else:
            color = my.colors.get(category)

        if not color:
            color = my.colors.get(default)
        if not color:
            color = category


        if category == 'background2' and not color:
            category = 'background'
            modifier += 10
            color = my.colors.get(category)
        if category == 'color2' and not color:
            category = 'color'
            modifier += 10
            color = my.colors.get(category)

        return Common.modify_color(color, modifier)
开发者ID:2gDigitalPost,项目名称:tactic_src,代码行数:31,代码来源:palette.py

示例3: get_color

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import modify_color [as 别名]
    def get_color(my, sobject, index):

        div = DivWdg()
        colors = [
            div.get_color("background3"),
            div.get_color("background3", -10),
            div.get_color("background3", -20),
        ]

        default_color = colors[index%3]

        pipeline_code = sobject.get_value("pipeline_code")
        if not pipeline_code:
            pipeline_code = "task"


        """
        parent = sobject.get_parent()
        if not parent:
            #return default_color
            pipeline_code = "task"
        else:
            pipeline_code = parent.get_value("pipeline_code", no_exception=True)
            if not pipeline_code:
                #return default_color
                pipeline_code = "task"
        """


        pipeline = Pipeline.get_by_code(pipeline_code)
        if not pipeline:
            return default_color

        """
        process_name = sobject.get_value("process")
        if not process_name:
            process_name = sobject.get_value("context")

        # get the process
        process = pipeline.get_process(process_name)
        if not process:
            return default_color
        """

        status = sobject.get_value("status")
        process = pipeline.get_process(status)
        if not process:
            return default_color

        color = process.get_color()
        if not color:
            return default_color
        else:
            color = Common.modify_color(color, 0)


        return color
开发者ID:blezek,项目名称:TACTIC,代码行数:59,代码来源:sobject_calendar_wdg.py

示例4: get_default_color

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import modify_color [as 别名]
    def get_default_color(process):
        global default_xml
        global OTHER_COLORS
        #MTM added the if statements linked to statuses
        if process.title() == 'Pending': 
            return "#d7d7d7"
        elif process.title() == 'Ready': 
            return "#b2cee8"
        elif process.title() == 'On_Hold': 
            return "#e8b2b8"
        elif process.title() == 'Client Response': 
            return "#ddd5b8"
        elif process.title() == 'Internal Rejection': 
            return "#ff0000"
        elif process.title() == 'External Rejection': 
            return "#ff0000"
        elif process.title() == 'Failed QC': 
            return "#ff0000"
        elif process.title() == 'Rejected': 
            return "#ff0000"
        elif process.title() == 'Fix Needed': 
            return "#c466a1"
        elif process.title() == 'In_Progress': 
            return "#f5f3a4"
        elif process.title() == 'DR In_Progress': 
            return "#d6e0a4"
        elif process.title() == 'BATON In_Progress': 
            return "#c6e0a4"
        elif process.title() == 'Export In_Progress': 
            return "#796999"
        elif process.title() == 'Need Buddy Check': 
            return "#e3701a"
        elif process.title() == 'Buddy Check In_Progress': 
            return "#1aade3"
        elif process.title() == 'Completed': 
            return "#b7e0a5"
        node = default_xml.get_node("pipeline/process[@name='%s']" % process.title())
        if node is None:
            return OTHER_COLORS.get(process.title())
        color = default_xml.get_attribute(node, "color")
        if not color:
            color = OTHER_COLORS.get(process.title())

        from pyasm.web import Palette
        theme = Palette.get()
        if theme == 'dark':
            color = Common.modify_color(color, -50)

        return color
开发者ID:2gDigitalPost,项目名称:tactic_src,代码行数:51,代码来源:task.py

示例5: get_default_color

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import modify_color [as 别名]
    def get_default_color(process):
        global default_xml
        global OTHER_COLORS
        node = default_xml.get_node("pipeline/process[@name='%s']" % process.title())
        if node is None:
            return OTHER_COLORS.get(process.title())
        color = default_xml.get_attribute(node, "color")
        if not color:
            color = OTHER_COLORS.get(process.title())

        from pyasm.web import Palette
        theme = Palette.get()
        if theme == 'dark':
            color = Common.modify_color(color, -50)

        return color
开发者ID:CeltonMcGrath,项目名称:TACTIC,代码行数:18,代码来源:task.py

示例6: get_color

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import modify_color [as 别名]
    def get_color(my, sobject, index):

        div = DivWdg()
        colors = [
            div.get_color("background3"),
            div.get_color("background3", -10),
            div.get_color("background3", -20),
        ]

        default_color = colors[index%3]

        try:
            color = sobject.get("color")
            if color:
                return color
        except:
            pass

        bg_color, text_color = my.color_map.get('status')
        if bg_color:
            color_value = bg_color.get(sobject.get_value('status'))
            
            if color_value:
                return color_value

        pipeline_code = sobject.get_value("pipeline_code", no_exception=True)
        if not pipeline_code:
            pipeline_code = "task"


        pipeline = Pipeline.get_by_code(pipeline_code)
        if not pipeline:
            return default_color

        status = sobject.get_value("status", no_exception=True)
        process = pipeline.get_process(status)
        if not process:
            return default_color

        color = process.get_color()
        if not color:
            return default_color
        else:
            color = Common.modify_color(color, 0)


        return color
开发者ID:0-T-0,项目名称:TACTIC,代码行数:49,代码来源:sobject_calendar_wdg.py

示例7: color

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import modify_color [as 别名]
    def color(my, category, modifier=0, default=None):

        if not category:
            category = "background"

        color = my.colors.get(category)
        if not color:
            color = my.colors.get(default)
        if not color:
            color = category

        # make default adjustments
        if category == "background2" and not color:
            category = "background"
            modifier += 10
            color = my.colors.get(category)
        if category == "color2" and not color:
            category = "color"
            modifier += 10
            color = my.colors.get(category)

        return Common.modify_color(color, modifier)
开发者ID:raidios,项目名称:TACTIC,代码行数:24,代码来源:palette.py

示例8: get_color

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import modify_color [as 别名]
    def get_color(my, sobject, index):

        div = DivWdg()
        pipeline_code = sobject.get_value("pipeline_code")
        if not pipeline_code:
            pipeline_code = "task"

        pipeline = Pipeline.get_by_code(pipeline_code)
        if not pipeline:
            return default_color

        status = sobject.get_value("status")
        process = pipeline.get_process(status)
        if not process:
            return default_color

        color = process.get_color()
        if not color:
            return default_color
        else:
            color = Common.modify_color(color, 0)

        return color
开发者ID:CeltonMcGrath,项目名称:TACTIC,代码行数:25,代码来源:sobject_calendar_wdg.py

示例9: modify_color

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import modify_color [as 别名]
 def modify_color(color, modifier):
     return Common.modify_color(color, modifier)
开发者ID:2gDigitalPost,项目名称:tactic_src,代码行数:4,代码来源:palette.py

示例10: get_color

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import modify_color [as 别名]
    def get_color(self, sobject, index):

        #color_mode = "custom"
        color_mode = self.kwargs.get("color_mode")
        if color_mode == "custom":
            column = "assigned"

            color_column = self.kwargs.get("color_column")
            color = self.kwargs.get("custom_colors")

            colors = {
                    'admin': '#ACC',
                    'librarian': '#CAA',
                    'NULL': '#CCC'
            }

            value = sobject.get(column)
            color = colors.get(value)

            if not color:
                color = colors.get("NULL")

            if not color:
                color = "#BBB"

            return color



        elif color_mode == "single":
            color = self.kwargs.get("color")
            if color:
                return color



        div = DivWdg()
        colors = [
            div.get_color("background3"),
            div.get_color("background3", -10),
            div.get_color("background3", -20),
        ]

        default_color = colors[index%3]

        try:
            color = sobject.get("color")
            if color:
                return color
        except:
            pass

        bg_color, text_color = self.color_map.get('status')
        if bg_color:
            color_value = bg_color.get(sobject.get_value('status'))
            
            if color_value:
                return color_value

        pipeline_code = sobject.get_value("pipeline_code", no_exception=True)
        if not pipeline_code:
            pipeline_code = "task"


        pipeline = Pipeline.get_by_code(pipeline_code)
        if not pipeline:
            return default_color

        status = sobject.get_value("status", no_exception=True)
        process = pipeline.get_process(status)
        if not process:
            return default_color

        color = process.get_color()
        if not color:
            return default_color
        else:
            color = Common.modify_color(color, 0)


        return color
开发者ID:mincau,项目名称:TACTIC,代码行数:83,代码来源:sobject_calendar_wdg.py


注:本文中的pyasm.common.Common.modify_color方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。