コード例 #1
0
ファイル: lionio_amis.py プロジェクト: daisy/lion
 def export(self, session, langid, export_type, additional_params=[]):
     # the xml file that acts as a template for exports
     xml_filepath = daisylion.db.modules.amis.templates.__path__[0]
     xml_filepath = os.path.join(xml_filepath, "amisAccessibleUi.xml")
     
     if export_type == 1:
         return amis_export.export_xml(session, xml_filepath, langid)
     elif export_type == 2:
         return amis_export.export_rc(session, langid)
     elif export_type == 3:
         output_folder = additional_params[0]
         local_audio_dir = additional_params[1]
         sz = len(output_folder)
         # make sure the folder path ends with a slash
         if sz > 0 and output_folder[sz-1] != '/':
             output_folder += '/'
         return amis_export.export_keys_book(session, xml_filepath, langid, output_folder, local_audio_dir)
コード例 #2
0
    def export(self, session, langid, export_type, additional_params=[]):
        # the xml file that acts as a template for exports
        xml_filepath = daisylion.db.modules.amis.templates.__path__[0]
        xml_filepath = os.path.join(xml_filepath, "amisAccessibleUi.xml")

        if export_type == 1:
            return amis_export.export_xml(session, xml_filepath, langid)
        elif export_type == 2:
            return amis_export.export_rc(session, langid)
        elif export_type == 3:
            output_folder = additional_params[0]
            local_audio_dir = additional_params[1]
            sz = len(output_folder)
            # make sure the folder path ends with a slash
            if sz > 0 and output_folder[sz - 1] != '/':
                output_folder += '/'
            return amis_export.export_keys_book(session, xml_filepath, langid,
                                                output_folder, local_audio_dir)
コード例 #3
0
ファイル: lionio_amis.py プロジェクト: daisy/lion
 def export(self, session, langid, export_type, additional_params=[]):
     # in each option below, you need to specify AMIS version as "3.0" or "3.1"
     amis_target_version = additional_params[0]
     # export type 1: export XML.
     if export_type == 1:
         return amis_export.export_xml(session, langid, amis_target_version)
     # export type 2: export RC.
     elif export_type == 2:
         return amis_export.export_rc(session, langid, amis_target_version)
     # export type 3: export keyboard shortcuts book.
     elif export_type == 3:
         output_folder = additional_params[1]
         local_audio_dir = additional_params[2]
         sz = len(output_folder)
         # make sure the folder path ends with a slash
         if sz > 0 and output_folder[sz - 1] != '/':
             output_folder += '/'
         return amis_export.export_keys_book(session, langid, amis_target_version, \
             output_folder, local_audio_dir)
コード例 #4
0
ファイル: lionio_amis.py プロジェクト: daisy/lion
 def export(self, session, langid, export_type, additional_params=[]):
     # in each option below, you need to specify AMIS version as "3.0" or "3.1"
     amis_target_version = additional_params[0]
     # export type 1: export XML. 
     if export_type == 1:
         return amis_export.export_xml(session, langid, amis_target_version)
     # export type 2: export RC.  
     elif export_type == 2:
         return amis_export.export_rc(session, langid, amis_target_version)
     # export type 3: export keyboard shortcuts book.  
     elif export_type == 3:
         output_folder = additional_params[1]
         local_audio_dir = additional_params[2]
         sz = len(output_folder)
         # make sure the folder path ends with a slash
         if sz > 0 and output_folder[sz-1] != '/':
             output_folder += '/'
         return amis_export.export_keys_book(session, langid, amis_target_version, \
             output_folder, local_audio_dir)