def set_file_notice(self, doc, text):
if self.has_package(doc) and self.has_file(doc):<EOL><INDENT>if not self.file_notice_set:<EOL><INDENT>self.file_notice_set = True<EOL>self.file(doc).notice = tagvaluebuilders.str_from_text(text)<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>raise CardinalityError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise OrderError('<STR_LIT>')<EOL><DEDENT>
Raises OrderError if no package or file defined.
        Raises CardinalityError if more than one.