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


Python Database.get_sample_count方法代码示例

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


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

示例1: logo

# 需要导入模块: from viper.core.database import Database [as 别名]
# 或者: from viper.core.database.Database import get_sample_count [as 别名]
def logo():
    print("""         _
        (_)
   _   _ _ ____  _____  ____
  | | | | |  _ \| ___ |/ ___)
   \ V /| | |_| | ____| |
    \_/ |_|  __/|_____)_| v{}
          |_|
    """.format(__version__))

    db = Database()
    count = db.get_sample_count()

    try:
        db.find('all')
    except Exception:
        print_error("You need to update your Viper database. Run 'python update.py -d'")
        sys.exit()

    if __project__.name:
        name = __project__.name
    else:
        name = 'default'

    print(magenta("You have " + bold(count)) +
          magenta(" files in your " + bold(name)) +
          magenta(" repository"))
开发者ID:Rafiot,项目名称:viper,代码行数:29,代码来源:console.py

示例2: logo

# 需要导入模块: from viper.core.database import Database [as 别名]
# 或者: from viper.core.database.Database import get_sample_count [as 别名]
def logo():
    print("""         _
        (_)
   _   _ _ ____  _____  ____
  | | | | |  _ \| ___ |/ ___)
   \ V /| | |_| | ____| |
    \_/ |_|  __/|_____)_| v1.3-dev
          |_|
    """)

    db = Database()
    count = db.get_sample_count()

    # Handle the New database format
    try:
        db.find('all', None)
    except:
        print_error("You need to update your viper database. Run 'python update.py -d'")
        sys.exit()


    if __project__.name:
        name = __project__.name
    else:
        name = 'default'

    print(magenta("You have " + bold(count)) +
          magenta(" files in your " + bold(name) +
          magenta(" repository".format(bold(name)))))
    if cfg.autorun.enabled and len(cfg.autorun.commands) == 0:
        print_warning("You have enabled autorun but not set any commands in viper.conf.")
开发者ID:diegslva,项目名称:viper,代码行数:33,代码来源:console.py

示例3: logo

# 需要导入模块: from viper.core.database import Database [as 别名]
# 或者: from viper.core.database.Database import get_sample_count [as 别名]
def logo():
    print("""         _                   
        (_) 
   _   _ _ ____  _____  ____ 
  | | | | |  _ \| ___ |/ ___)
   \ V /| | |_| | ____| |    
    \_/ |_|  __/|_____)_| v1.2
          |_|
    """)

    db = Database()
    count = db.get_sample_count()

    if __project__.name:
        name = __project__.name
    else:
        name = 'default'

    print(magenta("You have " + bold(count)) + 
          magenta(" files in your " + bold(name) + 
          magenta(" repository".format(bold(name)))))
开发者ID:idiom,项目名称:viper,代码行数:23,代码来源:console.py

示例4: landing

# 需要导入模块: from viper.core.database import Database [as 别名]
# 或者: from viper.core.database.Database import get_sample_count [as 别名]
def landing(p=False):
    contents = {}
    if p in project_list():
        __project__.open(p)
        contents['p'] = p
    else:
        __project__.open("../")
        contents['p'] = 'Main'
    db = Database() 
    # Pagination
    # 25 per page
    value = 25
    offset = 0
    contents['count'] = db.get_sample_count()
    page = request.query.page
    if not page:
        page = 0
    offset = int(page) * int(value) 
    contents['act_page'] = page   
    contents['latest'] = db.find('latest', value=value, offset=offset)
    # return the Template
    return template('index.tpl', **contents)
开发者ID:pig123,项目名称:viper,代码行数:24,代码来源:web.py

示例5: landing

# 需要导入模块: from viper.core.database import Database [as 别名]
# 或者: from viper.core.database.Database import get_sample_count [as 别名]
def landing(p=False):
    contents = {}
    if p in project_list():
        __project__.open(p)
        contents["p"] = p
    else:
        __project__.open("../")
        contents["p"] = "Main"
    db = Database()
    # Pagination
    # 25 per page
    value = 25
    offset = 0
    contents["count"] = db.get_sample_count()
    page = request.query.page
    if not page:
        page = 0
    offset = int(page) * int(value)
    contents["act_page"] = page
    contents["latest"] = db.find("latest", value=value, offset=offset)
    # return the Template
    return template("index.tpl", **contents)
开发者ID:noscripter,项目名称:viper,代码行数:24,代码来源:web.py

示例6: logo

# 需要导入模块: from viper.core.database import Database [as 别名]
# 或者: from viper.core.database.Database import get_sample_count [as 别名]
def logo():
    print("""         _                   
        (_) 
   _   _ _ ____  _____  ____ 
  | | | | |  _ \| ___ |/ ___)
   \ V /| | |_| | ____| |    
    \_/ |_|  __/|_____)_| v1.3-dev
          |_|
    """)

    db = Database()
    count = db.get_sample_count()

    if __project__.name:
        name = __project__.name
    else:
        name = 'default'

    print(magenta("You have " + bold(count)) + 
          magenta(" files in your " + bold(name) + 
          magenta(" repository".format(bold(name)))))
    if cfg.autorun.enabled and len(cfg.autorun.commands) == 0:
        print_warning("You have enabled autorun but not set any commands in viper.conf.")
开发者ID:kevthehermit,项目名称:ViperV2,代码行数:25,代码来源:console.py


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