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


Python Date.get_utc方法代码示例

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


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

示例1: _get_bar

# 需要导入模块: from pyasm.common import Date [as 别名]
# 或者: from pyasm.common.Date import get_utc [as 别名]
    def _get_bar(my, percent, proc_count, task):
        '''get a vertical bar indicating the progress of a task '''
        sobject = my.get_current_sobject()
        bar = DivWdg()
        if my.desc_checkbox_value == "on":
            bar.add_style('margin-right: 20px')
        else:
            bar.add_style('width: 10px')
        bar.add_style('float: left')
        cur_percent = 100.0
        increment = 100.0 / proc_count
        
        # get some task info
        assigned = 'unassigned'
        process = task.get_value('process')
        if task.get_value('assigned').strip():
            assigned = task.get_value('assigned')
            
        task_desc = task.get_value('description')
        if not task_desc:
            task_desc = 'n/a'

        start_date = task.get_value("bid_start_date")
        end_date = task.get_value("bid_end_date")
        if start_date:
            start_date = Date(db_date=start_date, show_warning=False).get_display_date()
        else:
            start_date = "?"
        if end_date:
            end_date = Date(db_date=end_date, show_warning=False).get_display_date()
        else:
            end_date = "?"

        # remove some spacing characters
        task_desc = re.sub('(\n|\r|\t)', ' ', task_desc)
        task_desc = re.sub('"', "'", task_desc)
        task_status = task.get_value('status')

        display_percent = percent
        if percent < 0:
            task_status = "%s <font color=red>(obsolete)</font>" % task_status
            display_percent = 0
      
        msg =  '<b>%s</b><br/><hr>%s<br/><span style=padding-left:1em>desc: %s</span><br/>' \
            '<span style=padding-left:1em>status:%s (%s%%)</span><br/>'\
            '<span style=padding-left:1em>%s - %s</span>'\
            % (process, assigned, task_desc, task_status, display_percent, start_date, end_date)
       
        if WebContainer.get_web().get_browser() == "IE":
            bar.add_event('onmouseover', "hint_bubble.show(event, '%s')" %msg)
        else:
            bar.add_tip(msg)



        from pyasm.widget import IconWdg
        end_date = task.get_value("bid_end_date")
        end_date = Date(db_date=end_date, show_warning=False)
        now_date = Date(show_warning=False)
        if now_date.get_utc() > end_date.get_utc() and percent != 100:
            alert_color = "#f00"
        else:
            alert_color = None


        for x in xrange(proc_count):
            cur_percent -= increment
            div = DivWdg()
            content = '&nbsp;'
            # unidentified status probably
            if percent < 0:
                content = '&mdash;'
                div.add_style('text-decoration: blink')
        
            div.add(content)
            div.add_style('width: 10px')
            if cur_percent < percent or cur_percent == 0:
                if alert_color:
                    div.add_style("background-color: %s" % alert_color)
                else:
                    div.add_style("background-color: %s" % my._get_color_code(percent))


            bar_height = my.get_option("bar_height")
            if not bar_height:
                bar_height = my.bar_select_value
            if not bar_height:
                bar_height = '3'
            div.add_style("height: %spx" % bar_height)
            # IE needs to set the font size to reduce the overall size
            div.add_style("font-size: %spx" % bar_height )
            if sobject.is_retired():
                div.add_class('task_status_bar_retired')
            else:
                if my.label_select_value == "abbr":
                    div.add_style("margin: -1px")

                #div.add_class("task_status_bar")
                #div.add_style("margin-top: 2px")
                div.add_border()
#.........这里部分代码省略.........
开发者ID:0-T-0,项目名称:TACTIC,代码行数:103,代码来源:parallel_status.py


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