def init_issue_tracker():
    global issueform
    global new_issueform
    global commentform
    
    issue_platforms  = WebCommonUtils.get_issue_types()

    issueform = pureform( 
        form.Textbox(issue_id_label, size=20),
        form.Dropdown(issue_platform_label, issue_platforms),
        form.Textbox(issue_summary_label, size=60),
        form.Dropdown(issue_status_label, issue_statuses),
        form.Dropdown(issue_priority_label, issue_priorities),
        form.Dropdown(issue_subgroup_label, issue_subgroups),
        form.Dropdown(issue_component_label, issue_components),
        form.Dropdown(issue_owner_label, issue_username_list),
        form.Dropdown(issue_submitter_label, issue_username_list),
        form.Textarea(issue_description_label, size=1024),
        form.Textarea(issue_comment_label, size=1024))
    
    new_issueform = pureform(                        
        form.Dropdown(issue_platform_label, issue_platforms),
        form.Textbox(issue_summary_label, size=60),
        form.Dropdown(issue_status_label, issue_statuses),
        form.Dropdown(issue_priority_label, issue_priorities),
        form.Dropdown(issue_subgroup_label, issue_subgroups),
        form.Dropdown(issue_component_label, issue_components),
        form.Dropdown(issue_owner_label, issue_username_list),
        form.Dropdown(issue_submitter_label, issue_username_list),
        form.Textarea(issue_description_label, size=1024))
    
    commentform = pureform( 
        form.Textarea(issue_comment_label, size=1024))
Exemplo n.º 2
0
def init_attr_def_forms(attr_definitions):
    global attrdef_form
 
    attrdef_form = pureform()
    
    attr_dict = attr_definitions.get_definitions()
    
    try:
        for key, attr_def in sorted(attr_dict.items()):
            attrdef_form.inputs += (form.Textbox(key, size=10),)
    except Exception, e:
        print 'Exception: %s' % str(e)
Exemplo n.º 3
0
from myform import pureform as pureform
import os
import AttributeDefinitions
import DbSession
import DataModel

# Form definition and callback class for the application configuration settings
attr_modify_comp_label = "Competition:"
attr_modify_team_number_label = "Team Number:"
attr_modify_attribute_name_label = "Attribute Name:"
attr_modify_old_value_label = "Old Attribute Value:"
attr_modify_new_value_label = "New Attribute Value:"

attr_modify_form = pureform( 
    form.Textbox(attr_modify_comp_label),
    form.Textbox(attr_modify_team_number_label),
    form.Textbox(attr_modify_attribute_name_label, size=60),
    form.Textbox(attr_modify_old_value_label, size=60),
    form.Textbox(attr_modify_new_value_label, size=60))

def get_form(global_config):
    global_config['logger'].debug( 'GET Attribute Modify Form' )
    
    form = attr_modify_form()
        
    return form

def process_form(global_config, form):
    global_config['logger'].debug( 'Process Attribute Modify Form' )

    comp = form[attr_modify_comp_label].value
    team = form[attr_modify_team_number_label].value
import WebCommonUtils

# Form definition and callback class for the application configuration settings
attr_delete_season_label = "Season:"
attr_delete_comp_label = "Competition:"
attr_delete_team_number_label = "Team Number:"
attr_delete_attribute_name_label = "Attribute Name:"
attr_delete_old_value_label = "Attribute Value:"
attr_delete_file_label = "Scouting Data File:"
attr_remove_file_processed_label = "Remove From Processed Files:"

yes_no_options = ['No', 'Yes']

attr_delete_form = pureform( 
    form.Textbox(attr_delete_season_label),
    form.Textbox(attr_delete_comp_label),
    form.Textbox(attr_delete_team_number_label),
    form.Textbox(attr_delete_attribute_name_label, size=60),
    form.Textbox(attr_delete_old_value_label, size=60) )

file_delete_form = pureform( 
    form.Textbox(attr_delete_season_label),
    form.Textbox(attr_delete_comp_label),
    form.Textbox(attr_delete_file_label, size=60),
    form.Dropdown(attr_remove_file_processed_label, yes_no_options ) )

def get_delete_attr_form(global_config):
    global_config['logger'].debug( 'GET Attribute Delete Form' )
    
    form = attr_delete_form()
        
    form[attr_delete_season_label].value = global_config['this_season']
cfg_excel_sheets_intf_label = "Excel Spreadsheet Interface:"


cfg_enable_disable_options = ['Enabled', 'Disabled']
cfg_issues_db_master_options = ['Yes', 'No']
cfg_season_options = ['2019', '2018']
cfg_comp_options = ['NHDUR', 'MAREA', 'NECMP', 'WEEK0']

cfgform = pureform( 
    form.Textbox(cfg_my_team_label, size=60),
    form.Textbox(cfg_my_district_label, size=60),
    form.Dropdown(cfg_this_comp_season_label, cfg_season_options),
    form.Dropdown(cfg_this_comp_label, cfg_comp_options),
    form.Dropdown(cfg_google_sheets_intf_label, cfg_enable_disable_options),
    form.Dropdown(cfg_excel_sheets_intf_label, cfg_enable_disable_options),
    #form.Textbox(cfg_this_event_code_label, size=60),
    #form.Textbox(cfg_other_comp_label, size=60),
    form.Textbox(cfg_attr_defs_label, size=60),
    form.Textbox(cfg_scouting_db_name_label, size=60),
    form.Textbox(cfg_issues_db_name_label, size=60),
    form.Dropdown(cfg_issues_db_master_label, cfg_issues_db_master_options),
    form.Textbox(cfg_debrief_db_name_label, size=60),
    form.Textbox(cfg_users_db_name_label, size=60),
    form.Textbox(cfg_issue_types_label, size=60))

def get_form(global_config):
    global_config['logger'].debug( 'GET Set Configuration Form' )
    
    form = cfgform()
    form[cfg_my_team_label].value = global_config['my_team']
    form[cfg_my_district_label].value = global_config['my_district']
    form[cfg_this_comp_label].value = global_config['this_competition']
Exemplo n.º 6
0
dest_dir_label = "Destination Project Directory:"
base_project_label = "Base Project Name:"
team_label = "Team Number:"
custom_button_label = "Use Custom Buttons:"

dest_project_label = "Destination Project Name:"
app_name_label = "Application Name:"
app_title_label = "Application Title:"
sheet_type_label = "Sheet Type:"
attr_defs_label = "Attributes Definition File:"
gen_action_label = 'Generate:'

myform = pureform( 
    form.Textbox(base_root_dir_label, size=60),
    form.Textbox(dest_root_dir_label, size=60),
    form.File(attr_defs_label, accept=".xlsx"),
    form.Textbox(team_label, size=10),
    form.Checkbox(custom_button_label),
    form.Dropdown(sheet_type_label, ['Pit', 'Match', 'Issue', 'Debrief', 'Demo'])
    )

    #form.Textbox(attr_defs_label,form.notnull,form.regexp('[\w_-]+\.xlsx', 'Must be .xlsx file'),size=60),
    #form.Dropdown(gen_action_label, ['Complete App', 'UI Components', 'Base App']))

def process_form(global_config, form):
    global_config['logger'].debug( 'Process UI Generator Form' )
    
    season = global_config['this_season']
    team = form[team_label].value
    sheet_type = form[sheet_type_label].value
    
    # form.d.boe and form['boe'].value are equivalent ways of
Exemplo n.º 7
0
base_dir_label = "Base Project Directory:"
base_project_label = "Base Project Name:"
dest_root_dir_label = "Destination Project Root:"
dest_dir_label = "Destination Project Directory:"
dest_project_label = "Destination Project Name:"
app_name_label = "Application Name:"
app_title_label = "Application Title:"
sheet_type_label = "Sheet Type:"
attr_defs_label = "Attributes Definition File:"
gen_action_label = 'Generate:'
myform = pureform( 
    form.Textbox(base_root_dir_label, size=60),
    form.Textbox(base_dir_label, size=60),
    form.Textbox(base_project_label, size=60),
    form.Textbox(dest_root_dir_label, size=60),
    form.Textbox(dest_dir_label, size=60),
    form.Textbox(dest_project_label, size=60),
    form.Textbox(app_name_label, size=60),
    form.Textbox(app_title_label, size=60),
    form.Dropdown(sheet_type_label, ['Pit', 'Match', 'Issue', 'Debrief', 'Demo']), 
    form.Textbox(attr_defs_label,form.notnull,form.regexp('[\w_-]+\.xlsx', 'Must be .xlsx file'),size=60),
    form.Dropdown(gen_action_label, ['Complete App', 'UI Components', 'Base App']))

def get_form(global_config):
    global_config['logger'].debug( 'GET UI Generator' )
        
    form = myform()
    return form

def process_form(global_config, form):
    global_config['logger'].debug( 'Process UI Generator Form' )
    
user_password_label = 'Password:'******'Confirm:'
user_access_level_label = 'Access_Level:'
user_taskgroups_label = 'Taskgroups:'
user_state_label = 'State:'

users_list = []

userform = pureform(
    form.Textbox(user_username_label, size=30),
    form.Password(user_password_label, size=30),
    form.Password(user_password_confirm_label, size=30),
    form.Textbox(user_emailaddress_label, size=30),
    form.Textbox(user_display_name_label, size=30),
    form.Textbox(user_nickname_label, size=30),
    form.Dropdown(user_access_level_label, user_access_levels),
    form.Dropdown(user_role_label, user_roles),
    form.Dropdown(user_subgroup_label, user_subgroups),
    form.Dropdown(user_contact_mode_label, user_contact_modes),
    form.Textbox(user_cellphone_label, size=30),
    form.Textbox(user_taskgroups_label, size=80),
    form.Dropdown(user_carrier_label, user_carriers),
    form.Dropdown(user_state_label, user_states))

userprofileform = pureform(
    form.Textbox(user_username_label, size=30),
    form.Password(user_password_label, size=30),
    form.Password(user_password_confirm_label, size=30),
    form.Textbox(user_emailaddress_label, size=30),
    form.Textbox(user_display_name_label, size=30),
    form.Textbox(user_nickname_label, size=30),
"""

from web import form
from myform import pureform as pureform

import web
import time

import DbSession
import IssueTrackerDataModel
import DebriefDataModel
import WebCommonUtils

match_comment_label = "Comment:"

commentform = pureform(form.Textarea(match_comment_label, size=1024))


def get_match_comment_form(global_config, competition, match_str):
    global_config["logger"].debug("GET match Comment Form, Issue: %s:%s", (competition, match_str))

    form = commentform()

    return form


def process_match_comment_form(global_config, form, competition, match_str, username):
    global_config["logger"].debug("Process Match Comment Form: %s:%s", (competition, match_str))

    session = DbSession.open_db_session(global_config["debriefs_db_name"] + global_config["this_season"])
    comment = form[match_comment_label].value