def __init__(my, dynamic_load=0, tab_key="tab", css=REG): my.tab_names = [] my.wdg_dict = {} my.dynamic_load = dynamic_load my.set_tab_key(tab_key) my.tab_style = css my.content_height = 0 my.mode = Container.get("tab_mode") # setting tab path my.tab_path = Container.get("tab_path") if not my.tab_path: my.tab_path = "Main" my.error_wdg = None my.div = DivWdg(css='left_content') if Environment.has_tactic_database(): my.invisible_list = ProdSetting.get_seq_by_key('invisible_tabs') else: my.invisible_list = [] super(TabWdg,my).__init__()
def __init__(self, dynamic_load=0, tab_key="tab", css=REG): self.tab_names = [] self.wdg_dict = {} self.dynamic_load = dynamic_load self.set_tab_key(tab_key) self.tab_style = css self.content_height = 0 self.mode = Container.get("tab_mode") # setting tab path self.tab_path = Container.get("tab_path") if not self.tab_path: self.tab_path = "Main" self.error_wdg = None self.div = DivWdg(css='left_content') if Environment.has_tactic_database(): self.invisible_list = ProdSetting.get_seq_by_key('invisible_tabs') else: self.invisible_list = [] super(TabWdg, self).__init__()
def __init__(my, dynamic_load=0, tab_key="tab", css=REG): my.tab_names = [] my.wdg_dict = {} my.dynamic_load = dynamic_load my.set_tab_key(tab_key) my.tab_style = css my.content_height = 0 my.mode = Container.get("tab_mode") # setting tab path my.tab_path = Container.get("tab_path") if not my.tab_path: my.tab_path = "Main" my.error_wdg = None my.div = DivWdg(css='left_content') if Environment.has_tactic_database(): my.invisible_list = ProdSetting.get_seq_by_key('invisible_tabs') else: my.invisible_list = [] super(TabWdg, my).__init__()
def __init__(self, dynamic_load=0, tab_key="tab", css=REG): self.tab_names = [] self.wdg_dict = {} self.dynamic_load = dynamic_load self.set_tab_key(tab_key) self.tab_style = css self.content_height = 0 self.mode = Container.get("tab_mode") # setting tab path self.tab_path = Container.get("tab_path") if not self.tab_path: self.tab_path = "Main" self.error_wdg = None self.div = DivWdg(css='left_content') if Environment.has_tactic_database(): self.invisible_list = ProdSetting.get_seq_by_key('invisible_tabs') else: self.invisible_list = [] super(TabWdg,self).__init__()
def main(server=None, input=None): """ :param server: the TacticServerStub object :param input: a dict with data like like search_key, search_type, sobject, and update_data :return: None """ try: from formatted_emailer import EmailDirections, email_sender todays_date = date.today() one_week_ago = (todays_date - timedelta(days=7)).strftime('%Y-%m-%d') past_due_titles = server.eval("@SOBJECT(twog/title['expected_delivery_date', 'is before', '{0}']['expected_delivery_date', 'is after', '{1}'])".format(todays_date, one_week_ago)) number_of_titles_past_due = len(past_due_titles) past_due_titles = [title.get('code') for title in past_due_titles] email_subject = 'There are {0} Titles that are past due'.format(number_of_titles_past_due) message = "The following titles are past due.<br/><br/>{0}<br/><br/>Please log into Tactic and change the " \ "due date on these Titles. If you don't know when that's supposed to be, you can just change it " \ "to today's date.".format(', '.join(past_due_titles)) recipients = ProdSetting.get_seq_by_key('past_due_alert_recipients') if not recipients: return context_data = { 'to_email': recipients[0], 'subject': email_subject, 'message': message, 'from_email': '*****@*****.**', 'from_name': 'Tactic', } if len(recipients) > 1: context_data.update({'ccs', ';'.join(recipients[1:])}) internal_template_file = '/opt/spt/custom/formatted_emailer/templates/past_due_title_notification.html' if context_data['to_email']: email_file_name = 'past_due_title_notification_{0}.html'.format(todays_date) email_sender.send_email(template=internal_template_file, email_data=context_data, email_file_name=email_file_name, server=server) except AttributeError as e: traceback.print_exc() print str(e) + '\nMost likely the server object does not exist.' raise e except KeyError as e: traceback.print_exc() print str(e) + '\nMost likely the input dictionary does not exist.' raise e except Exception as e: traceback.print_exc() print str(e) raise e
def get_notes_wdg(self): widget = Widget() help = HelpItemWdg('Notes tab', 'The Notes tab focuses on the display of notes. It includes both shot notes and submission notes for each shot.') widget.add(help) div = DivWdg(css="filter_box") text = TextWdg("shot_search") text.set_persist_on_submit() div.add("Shot Search: ") div.add(text) sequence_filter = SequenceFilterWdg() div.add(sequence_filter) # add Note Context dropdown # scope with config base, also used in DiscussionWdg and SObjectTaskTableElement config_base = 'prod_notes' context_select = ProcessFilterSelectWdg(name="%s_discussion_context" %config_base,\ has_empty=False, search_type='prod/shot', label='Note Context: ' ) context_select.add_empty_option("-- Any Context --") context_select._add_options() setting = "notes_prod_context" values_option = ProdSetting.get_seq_by_key(setting) if not values_option: data_dict = {'key': setting} prod_setting = ProdSetting.get_by_key(setting) ps_id = -1 if prod_setting: ps_id = prod_setting.get_id() context_select._set_append_widget(ps_id, data_dict) labels, values = context_select.get_select_values() if values_option: context_select.append_option('','') context_select.append_option('<< %s >>' %setting, ','.join(values_option)) for value in values_option: if value not in values: context_select.append_option(value, value) context_select.set_dom_options() div.add(context_select) hint = HintWdg('Submission notes for each shot are also included here') div.add(hint) div.add(IconRefreshWdg(long=False)) search_limit = SearchLimitWdg() div.add(search_limit) widget.add(div) # create a search search = Search("prod/shot") text_value = text.get_value() sequence_filter.alter_search(search) if text_value: filter = Search.get_compound_filter(text_value, ['code', 'description']) search.add_where(filter) search_limit.alter_search(search) sobjects = search.get_sobjects() table = TableWdg("prod/shot", config_base) table.set_class("table") table.set_sobjects(sobjects) widget.add(table) return widget
def get_display(self): outer_div = DivWdg() outer_div.set_id('new-external-rejection-form') # Set up the <input> widget for 'name' outer_div.add(HtmlElement.label('Name')) name_input = TextInputWdg(name='name') outer_div.add(name_input) root_cause_types = ProdSetting.get_seq_by_key('external_rejection_root_cause_types') root_cause_type_wdg = SelectWdg(name='root_cause_type', label='Root Cause Type') root_cause_type_wdg.add_empty_option() for root_cause_type in root_cause_types: root_cause_type_wdg.append_option(root_cause_type, root_cause_type) outer_div.add(root_cause_type_wdg) # TODO: Get this list from the schema, not hard coded video_rejection_reasons = [ ('video_cropping', 'Cropping'), ('video_digital_hits_macroblocking', 'Digital Hits / Macroblocking'), ('video_dropped_frames', 'Dropped Frames'), ('video_dropout', 'Dropout'), ('video_duplicate_frames', 'Duplicate Frames'), ('video_interlacing_on_a_progressive_file', 'Interlacing on a Progressive File'), ('video_motion_image_lag', 'Motion / Image Lag'), ('video_missing_elements', 'Missing Elements'), ('video_corrupt_file', 'Corrupt File'), ('video_incorrect_aspect_ratio', 'Incorrect Aspect Ratio'), ('video_incorrect_resolution', 'Incorrect Resolution'), ('video_incorrect_pixel_aspect_ratio', 'Incorrect Pixel Aspect Ratio'), ('video_incorrect_specifications', 'Incorrect Specifications'), ('video_incorrect_head_tail_format', 'Incorrect Head / Tail Format'), ('video_other', 'Other') ] audio_rejection_reasons = [ ('video_incorrect_audio_mapping', 'Incorrect Audio Mapping'), ('video_missing_audio_channel', 'Missing Audio Channel'), ('video_crackle_hiss_pop_static_ticks', 'Crackle / Hiss / Pop / Static / Ticks'), ('video_distortion', 'Distortion'), ('video_dropouts', 'Dropouts'), ('video_sync_issue', 'Sync Issue'), ('video_missing_elements', 'Missing Elements'), ('video_corrupt_missing_file', 'Corrupt / Missing File'), ('video_incorrect_specifications', 'Incorrect Specifications'), ('video_other', 'Other') ] metadata_rejection_reasons = [ ('metadata_missing_information', 'Missing Information'), ('metadata_incorrect_information', 'Incorrect Information'), ('metadata_incorrect_formatting', 'Incorrect Formatting'), ('metadata_other', 'Other') ] subtitle_rejection_reasons = [ ('subtitle_interlacing_on_subtitles', 'Interlacing on Subtitles'), ('subtitle_incorrect_subtitles', 'Incorrect Subtitles'), ('subtitle_sync_issue', 'Sync Issue'), ('subtitle_overlapping_other_text', 'Overlapping Other Text'), ('subtitle_other', 'Other') ] closed_captions_rejection_reasons = [ ('closed_captions_sync_issue', 'Sync Issue'), ('closed_captions_incorrect_cc', 'Incorrect CC'), ('closed_captions_overlapping_other_text', 'Overlapping Other Text'), ('closed_captions_other', 'Other') ] video_checkbox_table = self.setup_checkboxes_div('Video', video_rejection_reasons) audio_checkbox_table = self.setup_checkboxes_div('Audio', audio_rejection_reasons) metadata_checkbox_table = self.setup_checkboxes_div('MetaData', metadata_rejection_reasons) subtitle_checkbox_table = self.setup_checkboxes_div('Subtitles', subtitle_rejection_reasons) closed_captions_checkbox_table = self.setup_checkboxes_div('Closed Captions', closed_captions_rejection_reasons) outer_div.add(video_checkbox_table) outer_div.add(audio_checkbox_table) outer_div.add(metadata_checkbox_table) outer_div.add(subtitle_checkbox_table) outer_div.add(closed_captions_checkbox_table) return outer_div
def __init__(self, name="sobj_status", shot_status_setting="shot_status"): self.shot_status_setting = shot_status_setting self.statuses = ProdSetting.get_seq_by_key(self.shot_status_setting) super(SObjectStatusFilterWdg, self).__init__(name) self.set_persistence() self.label = "Shot Status Filter: "
def __init__(self, name="sobj_status", shot_status_setting="shot_status"): self.shot_status_setting = shot_status_setting self.statuses = ProdSetting.get_seq_by_key(self.shot_status_setting) super(SObjectStatusFilterWdg,self).__init__(name) self.set_persistence() self.label = "Shot Status Filter: "
def __init__(my, name="sobj_status", shot_status_setting="shot_status"): my.shot_status_setting = shot_status_setting my.statuses = ProdSetting.get_seq_by_key(my.shot_status_setting) super(SObjectStatusFilterWdg,my).__init__(name) my.set_persistence() my.label = "Shot Status Filter: "
def get_notes_wdg(self): widget = Widget() help = HelpItemWdg( 'Notes tab', 'The Notes tab focuses on the display of notes. It includes both shot notes and submission notes for each shot.' ) widget.add(help) div = DivWdg(css="filter_box") text = TextWdg("shot_search") text.set_persist_on_submit() div.add("Shot Search: ") div.add(text) sequence_filter = SequenceFilterWdg() div.add(sequence_filter) # add Note Context dropdown # scope with config base, also used in DiscussionWdg and SObjectTaskTableElement config_base = 'prod_notes' context_select = ProcessFilterSelectWdg(name="%s_discussion_context" %config_base,\ has_empty=False, search_type='prod/shot', label='Note Context: ' ) context_select.add_empty_option("-- Any Context --") context_select._add_options() setting = "notes_prod_context" values_option = ProdSetting.get_seq_by_key(setting) if not values_option: data_dict = {'key': setting} prod_setting = ProdSetting.get_by_key(setting) ps_id = -1 if prod_setting: ps_id = prod_setting.get_id() context_select._set_append_widget(ps_id, data_dict) labels, values = context_select.get_select_values() if values_option: context_select.append_option('', '') context_select.append_option('<< %s >>' % setting, ','.join(values_option)) for value in values_option: if value not in values: context_select.append_option(value, value) context_select.set_dom_options() div.add(context_select) hint = HintWdg('Submission notes for each shot are also included here') div.add(hint) div.add(IconRefreshWdg(long=False)) search_limit = SearchLimitWdg() div.add(search_limit) widget.add(div) # create a search search = Search("prod/shot") text_value = text.get_value() sequence_filter.alter_search(search) if text_value: filter = Search.get_compound_filter(text_value, ['code', 'description']) search.add_where(filter) search_limit.alter_search(search) sobjects = search.get_sobjects() table = TableWdg("prod/shot", config_base) table.set_class("table") table.set_sobjects(sobjects) widget.add(table) return widget
def get_display(self): outer_div = DivWdg() outer_div.set_id('new-external-rejection-form') # Set up the <input> widget for 'name' outer_div.add(HtmlElement.label('Name')) name_input = TextInputWdg(name='name') outer_div.add(name_input) root_cause_types = ProdSetting.get_seq_by_key( 'external_rejection_root_cause_types') root_cause_type_wdg = SelectWdg(name='root_cause_type', label='Root Cause Type') root_cause_type_wdg.add_empty_option() for root_cause_type in root_cause_types: root_cause_type_wdg.append_option(root_cause_type, root_cause_type) outer_div.add(root_cause_type_wdg) # TODO: Get this list from the schema, not hard coded video_rejection_reasons = [ ('video_cropping', 'Cropping'), ('video_digital_hits_macroblocking', 'Digital Hits / Macroblocking'), ('video_dropped_frames', 'Dropped Frames'), ('video_dropout', 'Dropout'), ('video_duplicate_frames', 'Duplicate Frames'), ('video_interlacing_on_a_progressive_file', 'Interlacing on a Progressive File'), ('video_motion_image_lag', 'Motion / Image Lag'), ('video_missing_elements', 'Missing Elements'), ('video_corrupt_file', 'Corrupt File'), ('video_incorrect_aspect_ratio', 'Incorrect Aspect Ratio'), ('video_incorrect_resolution', 'Incorrect Resolution'), ('video_incorrect_pixel_aspect_ratio', 'Incorrect Pixel Aspect Ratio'), ('video_incorrect_specifications', 'Incorrect Specifications'), ('video_incorrect_head_tail_format', 'Incorrect Head / Tail Format'), ('video_other', 'Other') ] audio_rejection_reasons = [ ('video_incorrect_audio_mapping', 'Incorrect Audio Mapping'), ('video_missing_audio_channel', 'Missing Audio Channel'), ('video_crackle_hiss_pop_static_ticks', 'Crackle / Hiss / Pop / Static / Ticks'), ('video_distortion', 'Distortion'), ('video_dropouts', 'Dropouts'), ('video_sync_issue', 'Sync Issue'), ('video_missing_elements', 'Missing Elements'), ('video_corrupt_missing_file', 'Corrupt / Missing File'), ('video_incorrect_specifications', 'Incorrect Specifications'), ('video_other', 'Other') ] metadata_rejection_reasons = [ ('metadata_missing_information', 'Missing Information'), ('metadata_incorrect_information', 'Incorrect Information'), ('metadata_incorrect_formatting', 'Incorrect Formatting'), ('metadata_other', 'Other') ] subtitle_rejection_reasons = [ ('subtitle_interlacing_on_subtitles', 'Interlacing on Subtitles'), ('subtitle_incorrect_subtitles', 'Incorrect Subtitles'), ('subtitle_sync_issue', 'Sync Issue'), ('subtitle_overlapping_other_text', 'Overlapping Other Text'), ('subtitle_other', 'Other') ] closed_captions_rejection_reasons = [ ('closed_captions_sync_issue', 'Sync Issue'), ('closed_captions_incorrect_cc', 'Incorrect CC'), ('closed_captions_overlapping_other_text', 'Overlapping Other Text'), ('closed_captions_other', 'Other') ] video_checkbox_table = self.setup_checkboxes_div( 'Video', video_rejection_reasons) audio_checkbox_table = self.setup_checkboxes_div( 'Audio', audio_rejection_reasons) metadata_checkbox_table = self.setup_checkboxes_div( 'MetaData', metadata_rejection_reasons) subtitle_checkbox_table = self.setup_checkboxes_div( 'Subtitles', subtitle_rejection_reasons) closed_captions_checkbox_table = self.setup_checkboxes_div( 'Closed Captions', closed_captions_rejection_reasons) outer_div.add(video_checkbox_table) outer_div.add(audio_checkbox_table) outer_div.add(metadata_checkbox_table) outer_div.add(subtitle_checkbox_table) outer_div.add(closed_captions_checkbox_table) return outer_div
def __init__(my, name="sobj_status", shot_status_setting="shot_status"): my.shot_status_setting = shot_status_setting my.statuses = ProdSetting.get_seq_by_key(my.shot_status_setting) super(SObjectStatusFilterWdg, my).__init__(name) my.set_persistence() my.label = "Shot Status Filter: "