本文整理汇总了Python中assets_helper.read函数的典型用法代码示例。如果您正苦于以下问题:Python read函数的具体用法?Python read怎么用?Python read使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了read函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_create_update_read_asset_utf8
def test_create_update_read_asset_utf8(self):
assets_helper.create(self.conn, asset_w)
asset_w_ = asset_w.copy()
asset_w_.update(**asset_w_diff)
assets_helper.update(self.conn, asset_w['asset_id'], asset_w_)
should_be_w_ = assets_helper.read(self.conn)
self.assertEqual([asset_w_], should_be_w_)
开发者ID:Geo-Joy,项目名称:screenly-ose,代码行数:8,代码来源:server_test.py
示例2: remove_asset
def remove_asset(asset_id):
asset = assets_helper.read(db_conn, asset_id)
try:
if asset['uri'].startswith(settings['assetdir']):
os.remove(asset['uri'])
except OSError:
pass
assets_helper.delete(db_conn, asset_id)
response.status = 204 # return an OK with no content
开发者ID:Geo-Joy,项目名称:sync-pi-ose,代码行数:9,代码来源:server.py
示例3: test_create_delete_asset
def test_create_delete_asset(self):
assets_helper.create(self.conn, asset_x)
assets_helper.delete(self.conn, asset_x['asset_id'])
assets_helper.create(self.conn, asset_y)
assets_helper.delete(self.conn, asset_y['asset_id'])
should_be_empty = assets_helper.read(self.conn)
self.assertEmpty(should_be_empty)
开发者ID:amit1870,项目名称:ridsc,代码行数:9,代码来源:server_test.py
示例4: generate_asset_list
def generate_asset_list():
logging.info('Generating asset-list...')
now = datetime.utcnow()
enabled_assets = [a for a in assets_helper.read(db_conn) if a['is_enabled']]
future_dates = [a[k] for a in enabled_assets for k in ['start_date', 'end_date'] if a[k] > now]
deadline = sorted(future_dates)[0] if future_dates else None
logging.debug('generate_asset_list deadline: %s', deadline)
playlist = assets_helper.get_playlist(db_conn)
if settings['shuffle_playlist']:
shuffle(playlist)
return (playlist, deadline)
开发者ID:Ultimatum22,项目名称:screenly-ose,代码行数:13,代码来源:viewer.py
示例5: test_create_update_read_asset
def test_create_update_read_asset(self):
assets_helper.create(self.conn, asset_x)
asset_x_ = asset_x.copy()
asset_x_.update(**asset_x_diff)
assets_helper.update(self.conn, asset_x['asset_id'], asset_x_)
assets_helper.create(self.conn, asset_y)
asset_y_ = asset_y.copy()
asset_y_.update(**asset_y_diff)
assets_helper.update(self.conn, asset_y['asset_id'], asset_y_)
should_be_y__x_ = assets_helper.read(self.conn)
self.assertEqual([asset_y_, asset_x_], should_be_y__x_)
开发者ID:amit1870,项目名称:ridsc,代码行数:13,代码来源:server_test.py
示例6: edit_asset
def edit_asset(asset_id):
return assets_helper.read(db_conn, asset_id)
开发者ID:Geo-Joy,项目名称:sync-pi-ose,代码行数:2,代码来源:server.py
示例7: api_assets
def api_assets():
assets = assets_helper.read(db_conn)
return make_json_response(assets)
开发者ID:Geo-Joy,项目名称:sync-pi-ose,代码行数:3,代码来源:server.py
示例8: test_create_read_asset
def test_create_read_asset(self):
assets_helper.create(self.conn, asset_x)
assets_helper.create(self.conn, asset_y)
should_be_y_x = assets_helper.read(self.conn)
self.assertEqual([asset_y, asset_x], should_be_y_x)
开发者ID:amit1870,项目名称:ridsc,代码行数:5,代码来源:server_test.py
注:本文中的assets_helper.read函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论