当前位置: 首页>>代码示例>>Python>>正文


Python Term.getTerm方法代码示例

本文整理汇总了Python中term.Term.getTerm方法的典型用法代码示例。如果您正苦于以下问题:Python Term.getTerm方法的具体用法?Python Term.getTerm怎么用?Python Term.getTerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在term.Term的用法示例。


在下文中一共展示了Term.getTerm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from term import Term [as 别名]
# 或者: from term.Term import getTerm [as 别名]

#.........这里部分代码省略.........
            if 'datasource' in COMMAND:
                datasource_session.execute(COMMAND, authorized_session.getToken())
            else:
                #datasource_session.getDataSources(authorized_session.getToken())
                datasource_session.createDataSource(authorized_session.getToken())
                datasource_PK1 = datasource_session.datasource_PK1
                print("[main] datasource_PK1: " + datasource_PK1)
                datasource_session.getDataSource(authorized_session.getToken())
                datasource_session.updateDataSource(authorized_session.getToken())


        if TERM or ALL:
            term_session = Term(target_url, authorized_session.getToken())
            #process term command
            print("\n[main] Run term command: " + ('ALL' if ALL else COMMAND) + '...')
            if 'term' in COMMAND:
                if (('delete' in COMMAND) or ('read' in COMMAND)):
                    print ("[main] Deleting or getting does not require a datasource.")
                else:
                    print("[main] datasource_PK1:  not known... searching...")
                    datasource_session = DataSource(target_url, authorized_session.getToken())
                    datasource_session.getDataSource(authorized_session.getToken())
                    datasource_PK1 = datasource_session.datasource_PK1
                    print("[main] datasource_PK1: " + datasource_PK1)
                    if (datasource_PK1 is None):
                        print ("[main] data source not found, creating for demo...")
                        datasource_session.createDataSource(authorized_session.getToken())
                        datasource_PK1 = datasource_session.datasource_PK1

                term_session.execute(COMMAND, datasource_PK1, authorized_session.getToken())
            else:
                #term_session.getTerms(authorized_session.getToken())
                term_session.createTerm(datasource_PK1, authorized_session.getToken())
                term_session.getTerm(authorized_session.getToken())
                term_session.updateTerm(datasource_PK1, authorized_session.getToken())

        if COURSE or ALL:
            course_session = Course(target_url, authorized_session.getToken())
            #process course command
            print("\n[main] Run course command: " + ('ALL' if ALL else COMMAND) + '...')
            if 'course' in COMMAND:
                if (('delete' in COMMAND) or ('read' in COMMAND)):
                    print ("[main] Deleting or getting does not require a datasource.")
                else:
                    print("[main] datasource_PK1:  not known... searching...")
                    datasource_session = DataSource(target_url, authorized_session.getToken())
                    datasource_session.getDataSource(authorized_session.getToken())
                    datasource_PK1 = datasource_session.datasource_PK1
                    print("[main] datasource_PK1: " + datasource_PK1)
                    if (datasource_PK1 is None):
                        print ("[main] data source not found, creating for demo...")
                        datasource_session.createDataSource(authorized_session.getToken())
                        datasource_PK1 = datasource_session.datasource_PK1
                course_session.execute(COMMAND, datasource_PK1, authorized_session.getToken())
            else:
                #course_session.getCourses(authorized_session.getToken())
                course_session.createCourse(datasource_PK1, authorized_session.getToken())
                course_session.getCourse(authorized_session.getToken())
                course_session.updateCourse(datasource_PK1, authorized_session.getToken())

        if USER or ALL:
            user_session = User(target_url, authorized_session.getToken())
            #process user command
            print("\n[main] Run user command: " + ('ALL' if ALL else COMMAND) + '...')
            if 'user' in COMMAND:
                if (('delete' in COMMAND) or ('read' in COMMAND)):
开发者ID:hanleybrand,项目名称:BBDN-REST-DEMO_Python,代码行数:70,代码来源:restdemo.py


注:本文中的term.Term.getTerm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。