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
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