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


Python ProdSetting.get_value_by_key方法代码示例

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


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

示例1: get_display

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def get_display(my):

        # just refresh the whole thing 
        widget = DivWdg()
        
        outer_widget = DivWdg(css='spt_view_panel')
        search_div = DivWdg()
        search_bvr = {
            'type':         'click_up',
            'cbjs_action':  'spt.dg_table.search_cbk(evt, bvr)',
            'override_class_name': 'tactic.ui.cgapp.AppShotPanelWdg',
            'override_target': 'bvr.src_el.getParent(".spt_app_shot_panel")',
            'extra_args': {'instance_search_type': my.instance_search_type,
                        'asset_search_type': my.asset_search_type}
            #'panel_id':     'main_body_search'
            
        }

        # WARNING: this is made just for main search box and  won't be compatible with the simple search wdg
        search_wdg = SearchWdg(search_type=my.search_type, custom_search_view='search_shot_loader', parent_key='', filter=''\
            , display='block', custom_filter_view='', state=None, run_search_bvr=search_bvr)

        #from tactic.ui.app.simple_search_wdg import SimpleSearchWdg
        #search_wdg = SimpleSearchWdg(search_type=my.search_type, search_view=my.simple_search_view, state=None, run_search_bvr=search_bvr)
        search_div.add( HtmlElement.spacer_div(1,10) )
        search_div.add(search_wdg)

        # if there is result, it could only be one shot
        search = search_wdg.get_search()
        shots = search.get_sobjects()

        # avoid getting a shot when no shot is selected
        if not my.shot_code and len(shots) == 1:
            my.shot_code = shots[0].get_code()
        
        outer_widget.add(search_div)

        my.set_as_panel(outer_widget, class_name='spt_panel spt_view_panel spt_app_shot_panel')
        #show_shot_panel = False
        #if show_shot_panel:
        panel = ViewPanelWdg( search_type=my.search_type, \
                 inline_search=True, show_search='false', show_refresh='false', view=my.view, \
                run_search_bvr=search_bvr, simple_search_view=my.simple_search_view)
        panel.set_sobjects(shots)

        widget.add(panel)
         
        show_instances_in_shot = ProdSetting.get_value_by_key("show_instances_in_shot_panel")
        if show_instances_in_shot != "false":

            widget.add(HtmlElement.h3("Asset Instances in Shot [%s]" %my.shot_code))
            widget.add(HtmlElement.br(2))
            asset_inst_panel = AppAssetInstancePanelWdg(search_type=my.search_type, instance_search_type=my.instance_search_type, asset_search_type=my.asset_search_type, shot_code=my.shot_code, show_search='false')
            widget.add(asset_inst_panel)
        outer_widget.add(widget)
        return outer_widget
开发者ID:0-T-0,项目名称:TACTIC,代码行数:58,代码来源:app_panel_wdg.py

示例2: get_reg_hours

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def get_reg_hours():
        # FIXME: this shold be in pyasm.biz, not pyasm.prod.biz
        from pyasm.prod.biz import ProdSetting
        reg_hours = ProdSetting.get_value_by_key("reg_hours")
        if not reg_hours:
            # auto create if it does not exist
            ProdSetting.create('reg_hours', '10',  'sequence', \
                description='regular work hours', search_type='sthpw/project')

        return reg_hours
开发者ID:davidsouthpaw,项目名称:TACTIC,代码行数:12,代码来源:project.py

示例3: get_context_wdg

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def get_context_wdg(my, search_type):
        '''drop down which selects which context to checkin'''
        # add a filter
        # use a regular SelectWdg with submit instead of FilterSelectWdg
        filter_div = FloatDivWdg("Context / subcontext:")
        select = SelectWdg("publish_context")
        labels, values = my.get_context_data(search_type, my.process)
        select.set_option("values", "|".join(values))
        select.set_option("labels", "|".join(labels))
        select.append_option('publish','publish')
        select.add_style("font-size: 0.8em")
        select.add_style("margin: 0px 3px")

        # explicitly set the value
        current = select.get_value()
        if current in values:
            context = current
        elif values:
            context = values[0]
        else:
            context = ""
 
        web = WebContainer.get_web()
        web.set_form_value("publish_context", context)

        select.set_value( context )

        # set it to a instance variable
        my.context_select = select

        filter_div.add(select)

        # if specified, add a sub_context
        base_search_type = SearchType(search_type).get_base_key()
        settings = ProdSetting.get_value_by_key("%s/sub_context" % context,\
                base_search_type)
        filter_div.add( "/ ")
        sub_context = None
        if settings:
            sub_context = SelectWdg("publish_sub_context")
            sub_context.set_option("values", settings)
            sub_context.set_submit_onchange()
            sub_context.add_empty_option("<- Select ->")
        else:
            # provide a text field
            sub_context = TextWdg("publish_sub_context")
            sub_context.set_attr('size','10') 
        sub_context.set_persistence()
        filter_div.add( sub_context )
        my.sub_context_select = sub_context
        #filter_div.add_style('padding-right','10px')

        return filter_div
开发者ID:0-T-0,项目名称:TACTIC,代码行数:55,代码来源:filter_wdg.py

示例4: __init__

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def __init__(my, **kwargs):
        my.frames = kwargs.get("frames")
        my.fps = kwargs.get("fps")
        if not my.fps:
            from pyasm.prod.biz import ProdSetting
            my.fps = ProdSetting.get_value_by_key("fps")
        if not my.fps:
            my.fps = 24

        if not my.frames:
            timecode = kwargs.get("timecode")
            my.frames = my.calculate_frames(timecode, my.fps)
开发者ID:CeltonMcGrath,项目名称:TACTIC,代码行数:14,代码来源:timecode.py

示例5: convert_to_time

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def convert_to_time(self, frames):
        fps = ProdSetting.get_value_by_key("fps")
        if not fps:
            fps = 24
        else:
            fps = int(fps)

        minutes = frames / (60*fps)
	frames = frames - (minutes*60*fps)
        seconds = frames / fps
        extra = frames % fps

        time = "%0.2dm:%0.2ds.%0.2d" % (minutes, seconds, extra)
        return time
开发者ID:mincau,项目名称:TACTIC,代码行数:16,代码来源:statistics_wdg.py

示例6: get_web_file_size

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def get_web_file_size(my):
        from pyasm.prod.biz import ProdSetting
        web_file_size = ProdSetting.get_value_by_key('web_file_size')
        thumb_size = (640, 480)
        if web_file_size:
            parts = re.split('[\Wx]+', web_file_size)
            
            thumb_size = (640, 480)
            if len(parts) == 2:
                try:
                    thumb_size = (int(parts[0]), int(parts[1]))
                except ValueError:
                    thumb_size = (640, 480)

        return thumb_size
开发者ID:hellios78,项目名称:TACTIC,代码行数:17,代码来源:file.py

示例7: handle_tab

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
 def handle_tab(self, tab):
     tab.add(self.get_shot_list_wdg, _("Shot List") )
     tab.add(self.get_summary_wdg, _("Summary") )
     tab.add(self.get_milestone_wdg, _("Milestones") )
     tab.add(MultiPlannerWdg, _("Planners") )
     tab.add(self.get_task_manager_wdg, _("Tasks") )
     #tab.add(ShotParentWdg, "Shot Parenting") )
     tab.add(self.get_artist_wdg, _("Artist (Shots)") )
     tab.add(self.get_supe_wdg, _("Supe (Shots)") )
     tab.add(self.get_layer_wdg, _("Layers") )
     tab.add(self.get_comp_wdg, _("Composites") )
     tab.add(self.get_render_log_wdg, _("Render Log") )
     tab.add(self.get_seq_wdg, _("Sequences") )
     if ProdSetting.get_value_by_key('shot_hierarchy') == 'episode_sequence':
         tab.add(self.get_episode_wdg, _("Episodes") )
     tab.add(self.get_notes_wdg, _("Notes") )
开发者ID:mincau,项目名称:TACTIC,代码行数:18,代码来源:shot_tab_wdg.py

示例8: __init__

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def __init__(self, **kwargs):
        self.frames = kwargs.get("frames")
        self.frames = float(self.frames)

        self.fps = kwargs.get("fps")
        if not self.fps:
            from pyasm.prod.biz import ProdSetting
            self.fps = ProdSetting.get_value_by_key("fps")
            self.fps = int(self.fps)
        if not self.fps:
            self.fps = 24

        if not self.frames:
            timecode = kwargs.get("timecode")
            self.frames = self.calculate_frames(timecode, self.fps)

        # handle cases where frames has a decimal: ie: 400.4
        self.frames = int(float(self.frames))
开发者ID:mincau,项目名称:TACTIC,代码行数:20,代码来源:timecode.py

示例9: __init__

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def __init__(my, **kwargs):
        my.frames = kwargs.get("frames")
        my.frames = float(my.frames)

        my.fps = kwargs.get("fps")
        if not my.fps:
            from pyasm.prod.biz import ProdSetting
            my.fps = ProdSetting.get_value_by_key("fps")
            my.fps = int(my.fps)
        if not my.fps:
            my.fps = 24

        if not my.frames:
            timecode = kwargs.get("timecode")
            my.frames = my.calculate_frames(timecode, my.fps)

        # handle cases where frames has a decimal: ie: 400.4
        my.frames = int(float(my.frames))
开发者ID:0-T-0,项目名称:TACTIC,代码行数:20,代码来源:timecode.py

示例10: show_platform_connection

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
def show_platform_connection():
    """
    A short convenience function to check Tactic's Project Settings for a value called
    show_platform_connection_on_hot_today, which tells the hot list whether or not to display Client-Platform
    connections as part of Edel's tasks.

    show_platform_connection_on_hot_today should be a string value set to either 'True' or 'False' (sadly Tactic
    does not support Boolean values for ProdSettings)

    :return: Boolean
    """

    # Cast the value to str, just in case it returns None
    show_platform_connection_string = str(ProdSetting.get_value_by_key('show_platform_connection_on_hot_today'))

    if show_platform_connection_string.lower() == 'true':
        return True
    else:
        return False
开发者ID:2gDigitalPost,项目名称:custom,代码行数:21,代码来源:hottoday_utils.py

示例11: get_sobject_base

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def get_sobject_base(my, dirs):
        # add <project_code>/<table>
        search_type_obj = my.sobject.get_search_type_obj()


        project_code = my.sobject.get_project().get_code()
        dirs.append( project_code )
        #db_name = search_type_obj.get_database()
        #dirs.append( db_name )

        from pyasm.prod.biz import ProdSetting
        if project_code not in ["admin", 'sthpw']:
            icon_separation = ProdSetting.get_value_by_key("use_icon_separation")           
            if not icon_separation:
                # put in a default
                icon_separation = "false"
                ProdSetting.create('use_icon_separation', icon_separation, 'string',\
                    description='Determines whether icons are in complete separate directories')
               
            if icon_separation == 'true':
                if my.snapshot and my.snapshot.get_value("context") == "icon":
                    dirs.append("icon")
                elif my.get_file_type() == "icon":
                    dirs.append("icon")


        #process = my.snapshot.get_value("process")
        #search_type = my.snapshot.get_value("search_type")

        # add a concept of branching
        #    from pyasm.web import WidgetSettings
        #    branch = WidgetSettings.get_value_by_key("current_branch")
        #    #WidgetSettings.set_value_by_key("current_branch", branch)
        #    if branch:
        #        #dirs.append( "perforce" )
        #        dirs.append( branch )

        table = search_type_obj.get_table()
        dirs.append( table )

        return dirs
开发者ID:davidsouthpaw,项目名称:TACTIC,代码行数:43,代码来源:dir_naming.py

示例12: get_display

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
 def get_display(my):   
     from pyasm.prod.biz import ProdSetting
     my.code = str(my.kwargs.get('code'))
     my.sk = str(my.kwargs.get('sk'))
     my.movement_code = str(my.kwargs.get('movement_code'))
     my.source_contexts = ProdSetting.get_value_by_key('source_contexts').split('|')
     ms = MovementScripts(movement_code=my.movement_code)
     table = Table()
     table.add_attr('class','movement_twog_easy_checkin')
     table.add_attr('width','100%s' % '%')
     table.add_row()
     title_bar = table.add_cell('<b><u>Checkin New File</u></b>')
     title_bar.add_attr('align','center')
     title_bar.add_attr('colspan','4')
     title_bar.add_style('font-size: 110%ss' % '%')
     processes_sel = SelectWdg('source_process_select')
     for ctx in my.source_contexts:
         processes_sel.append_option(ctx,ctx)
     table.add_row()
     mini0 = Table()
     mini0.add_row()
     mini0.add_cell('Checkin Context: ')
     mini0.add_cell(processes_sel)
     table.add_cell(mini0)
     mini1 = Table()
     mini1.add_row()
     file_holder = mini1.add_cell(' ')
     file_holder.add_attr('width','100%s' % '%')
     file_holder.add_attr('align','center')
     file_holder.add_attr('class','file_holder')
     button = mini1.add_cell('<input type="button" value="Browse"/>')
     button.add_attr('align','right')
     button.add_style('cursor: pointer;')
     button.add_behavior(ms.get_easy_checkin_browse_behavior())
     big_button = mini1.add_cell('<input type="button" value="Check In" class="easy_checkin_commit" disabled/>')
     big_button.add_style('cursor: pointer;')
     big_button.add_behavior(ms.get_easy_checkin_commit_behavior(my.sk))
     table.add_cell(mini1)
     return table
开发者ID:2gDigitalPost,项目名称:custom,代码行数:41,代码来源:movement_maker.py

示例13: get_seq_wdg

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def get_seq_wdg(self):
        
        
        widget = Widget()
        help = HelpItemWdg('Sequences tab', 'The Sequences tab lets you create sequences which can be used to relate to shots. Each shot has a sequence code attribute which you can assign to.')
        widget.add(help)
        div = DivWdg(css='filter_box')
        search_columns = Sequence.get_search_columns()
        search_filter = SearchFilterWdg(name="sequence_search", columns=search_columns) 
        div.add(SpanWdg(search_filter, css='med'))
        search = Search("prod/sequence")
        search_filter.alter_search(search)

        
        widget.add(div)
        view = 'table'
        if ProdSetting.get_value_by_key('shot_hierarchy') == 'episode_sequence':
            view ='table_episode'
        table = TableWdg("prod/sequence", view)
        table.set_search(search)
        widget.add(table)

        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:25,代码来源:shot_tab_wdg.py

示例14: get_custom_setting

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
 def get_custom_setting(my, key):
     from pyasm.biz import ProdSetting
     value = ProdSetting.get_value_by_key(key)
     return value
开发者ID:davidsouthpaw,项目名称:TACTIC,代码行数:6,代码来源:dir_naming.py

示例15: _process_image

# 需要导入模块: from pyasm.prod.biz import ProdSetting [as 别名]
# 或者: from pyasm.prod.biz.ProdSetting import get_value_by_key [as 别名]
    def _process_image(my, file_name):

        base, ext = os.path.splitext(file_name)

        # get all of the extensions
        exts = File.get_extensions(file_name)
        frame = 0
        if len(exts) == 2:
            try:
                frame = int(exts[0])
                base = base.replace(".%s" % exts[0], '' )
            except ValueError:
                frame = 0

        if frame:
            icon_file_name = "%s_icon.%s.png" % (base, exts[0])
            web_file_name = "%s_web.%s.jpg" % (base, exts[0])
        else:
            icon_file_name = "%s_icon.png" % base
            web_file_name = "%s_web.jpg" % base

        tmp_icon_path = "%s/%s" % (my.tmp_dir, icon_file_name)

        tmp_web_path = "%s/%s" % (my.tmp_dir, web_file_name)

        # create the web image
        try:
            if my.texture_mode:
                my._resize_texture(my.file_path, tmp_web_path, 0.5)
                my.web_path = tmp_web_path

                # create the icon
                thumb_size = (120,100)
                my._resize_image(tmp_web_path, tmp_icon_path, thumb_size)

                my.icon_path = tmp_icon_path
            elif my.icon_mode: # just icon, no web
                # create the icon only
                thumb_size = (120,100)
                my._resize_image(my.file_path, tmp_icon_path, thumb_size)
                my.icon_path = tmp_icon_path


            else:
                from pyasm.prod.biz import ProdSetting
                web_file_size = ProdSetting.get_value_by_key('web_file_size')
                thumb_size = (640, 480)
                if web_file_size:
                    parts = re.split('[\Wx]+', web_file_size)
                    
                    thumb_size = (640, 480)
                    if len(parts) == 2:
                        try:
                            thumb_size = (int(parts[0]), int(parts[1]))
                        except ValueError:
                            thumb_size = (640, 480)
                
                my._resize_image(my.file_path, tmp_web_path, thumb_size)

                my.web_path = tmp_web_path

                # create the icon
                thumb_size = (120,100)
                my._resize_image(tmp_web_path, tmp_icon_path, thumb_size)

                my.icon_path = tmp_icon_path

            # check icon file size, reset to none if it is empty
            # TODO: use finally in Python 2.5
            if my.web_path:
                web_path_size = os.stat(my.web_path)[stat.ST_SIZE]
                if not web_path_size:
                    my.web_path = None
            if my.icon_path:
                icon_path_size = os.stat(my.icon_path)[stat.ST_SIZE]
                if not icon_path_size:
                    my.icon_path = None
        except IOError, e:
            Environment.add_warning("Could not process file", \
                "%s - %s" % (my.file_path, e.__str__()))
            my.web_path = None
            my.icon_path = None
开发者ID:blezek,项目名称:TACTIC,代码行数:84,代码来源:file.py


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