本文整理匯總了Python中pyasm.prod.biz.ProdSetting.create方法的典型用法代碼示例。如果您正苦於以下問題:Python ProdSetting.create方法的具體用法?Python ProdSetting.create怎麽用?Python ProdSetting.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyasm.prod.biz.ProdSetting
的用法示例。
在下文中一共展示了ProdSetting.create方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_reg_hours
# 需要導入模塊: from pyasm.prod.biz import ProdSetting [as 別名]
# 或者: from pyasm.prod.biz.ProdSetting import create [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
示例2: get_sobject_base
# 需要導入模塊: from pyasm.prod.biz import ProdSetting [as 別名]
# 或者: from pyasm.prod.biz.ProdSetting import create [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