prompt
large_stringlengths 72
9.34k
| completion
large_stringlengths 0
7.61k
|
---|---|
<|file_name|>test_bea.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import io
import os
from dlstats.fetchers.bea import BEA as Fetcher
import httpretty
from dlstats.tests.base import RESOURCES_DIR as BASE_RESOURCES_DIR
from dlstats.tests.fetchers.base import BaseFetcherTestCase
import unittest
from unittest import mock
RESOURCES_DIR = os.path.abspath(os.path.join(BASE_RESOURCES_DIR, "bea"))
DATA_BEA_10101_An = {
"filepath": os.path.abspath(os.path.join(RESOURCES_DIR, "nipa-section1.xls.zip")),
"DSD": {
"provider": "BEA",
"filepath": None,
"dataset_code": "nipa-section1-10101-a",
"dsd_id": "nipa-section1-10101-a",
"is_completed": True,
"categories_key": "nipa-section1",
"categories_parents": ["national", "nipa"],
"categories_root": ["national", "nipa", "nipa-fa2004", "nipa-underlying"],
"concept_keys": ['concept', 'frequency'],
"codelist_keys": ['concept', 'frequency'],
"codelist_count": {
"concept": 25,
"frequency": 1
},
"dimension_keys": ['concept', 'frequency'],
"dimension_count": {
"concept": 25,
"frequency": 1
},
"attribute_keys": [],
"attribute_count": None,
},
"series_accept": 25,
"series_reject_frequency": 0,
"series_reject_empty": 0,
"series_all_values": 1175,
"series_key_first": "A191RL1-A",
"series_key_last": "A191RP1-A",
"series_sample": {
'provider_name': 'BEA',
'dataset_code': 'nipa-section1-10101-a',
'key': 'A191RL1-A',
'name': 'Gross domestic product - Annually',
'frequency': 'A',
'last_update': None,
'first_value': {
'value': '3.1',
'period': '1969',
'attributes': None,
},
'last_value': {
'value': '2.4',
'period': '2015',
'attributes': None,
},
'dimensions': {
'concept': 'a191rl1',
"frequency": 'a'
},
'attributes': None,
}
}
def _get_datasets_settings(self):
return {
"nipa-section1-10101-a": {
'dataset_code': 'nipa-section1-10101-a',
'name': 'Table 1.1.1. Percent Change From Preceding Period in Real Gross Domestic Product - Annually',
'last_update': None,
'metadata': {
'filename': 'nipa-section1.xls.zip',
'sheet_name': '10101 Ann',
'url': 'http://www.bea.gov/national/nipaweb/GetCSV.asp?GetWhat=SS_Data/Section1All_xls.zip&Section=2'
},
}
}
class FetcherTestCase(BaseFetcherTestCase):
# nosetests -s -v dlstats.tests.fetchers.test_bea:FetcherTestCase
FETCHER_KLASS = Fetcher
DATASETS = {
'nipa-section1-10101-a': DATA_BEA_10101_An
}
DATASET_FIRST = "nipa-fa2004-section1-101-a"
DATASET_LAST = "nipa-underlying-section9-90500U-a"
DEBUG_MODE = False
def _load_files(self, dataset_code):
url = "http://www.bea.gov/national/nipaweb/GetCSV.asp?GetWhat=SS_Data/Section1All_xls.zip&Section=2"
self.register_url(url,
self.DATASETS[dataset_code]["filepath"])
@httpretty.activate
@unittest.skipUnless('FULL_TEST' in os.environ, "Skip - no full test")
def test_load_datasets_first(self):
dataset_code = "nipa-section1-10101-a"
self._load_files(dataset_code)
self.assertLoadDatasetsFirst([dataset_code])
@httpretty.activate
@unittest.skipUnless('FULL_TEST' in os.environ, "Skip - no full test")
def test_load_datasets_update(self):
dataset_code = "nipa-section1-10101-a"
self._load_files(dataset_code)
self.assertLoadDatasetsUpdate([dataset_code])
#@httpretty.activate
@unittest.skipIf(True, "TODO")
def test_build_data_tree(self):
dataset_code = "nipa-section1-10101-a"
self.assertDataTree(dataset_code)
@httpretty.activate
@mock.patch("dlstats.fetchers.bea.BEA._get_datasets_settings", _get_datasets_settings)
def <|fim_middle|>(self):
# nosetests -s -v dlstats.tests.fetchers.test_bea:FetcherTestCase.test_upsert_dataset_10101
dataset_code = "nipa-section1-10101-a"
self._load_files(dataset_code)
self.assertProvider()
dataset = self.assertDataset(dataset_code)
names = {
'a191rl1': 'Gross domestic product',
'dpcerl1': 'Personal consumption expenditures',
'dgdsrl1': 'Personal consumption expenditures - Goods',
'ddurrl1': 'Personal consumption expenditures - Goods - Durable goods',
'dndgrl1': 'Personal consumption expenditures - Goods - Nondurable goods',
'dserrl1': 'Personal consumption expenditures - Services',
'a006rl1': 'Gross private domestic investment',
'a007rl1': 'Gross private domestic investment - Fixed investment',
'a008rl1': 'Gross private domestic investment - Fixed investment - Nonresidential',
'y033rl1': 'Gross private domestic investment - Fixed investment - Nonresidential - Equipment',
'a011rl1': 'Gross private domestic investment - Fixed investment - Residential',
'a020rl1': 'Net exports of goods and services - Exports',
'a191rp1': 'Addendum: - Gross domestic product, current dollars'
}
for k, v in names.items():
self.assertTrue(k in dataset["codelists"]["concept"])
self.assertEquals(dataset["codelists"]["concept"][k], v)
series_list = self.assertSeries(dataset_code)
series_keys = {s["key"].lower(): s for s in series_list}
for k, v in names.items():
search_k = "%s-a" % k
search_name = "%s - Annually" % v
self.assertTrue(search_k in series_keys, "%s not in series_keys" % search_k)
self.assertEquals(series_keys[search_k]["name"], search_name)
for series in series_list:
self.assertEquals(series["last_update_ds"], dataset["last_update"])
<|fim▁end|> | test_upsert_dataset_10101 |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""<|fim▁hole|> flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))<|fim▁end|> | user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid. |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
<|fim_middle|>
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | """Provides a form to request an account."""
return flask.render_template("request_account.html") |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
<|fim_middle|>
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | """Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
<|fim_middle|>
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | """Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
<|fim_middle|>
<|fim▁end|> | """Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key)) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
<|fim_middle|>
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
<|fim_middle|>
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
<|fim_middle|>
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
<|fim_middle|>
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
<|fim_middle|>
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
<|fim_middle|>
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
<|fim_middle|>
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
<|fim_middle|>
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home")) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
<|fim_middle|>
<|fim▁end|> | return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key)) |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def <|fim_middle|>():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | request_account |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def <|fim_middle|>():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | request_account_submit |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def <|fim_middle|>(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def create_account_submit(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | create_account |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint.route("/request/submit", methods=["POST"])
def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None)
last_name = flask.request.form.get("last_name", None)
if uid is None or last_name is None:
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("account.request_account"))
success, error_msg = helpers.handle_request_account(uid, last_name)
if success:
flask.flash(
"An email has been sent with a link to create your account.")
return flask.redirect(flask.url_for("home"))
else:
flask.flash(error_msg)
return flask.redirect(flask.url_for("account.request_account"))
@blueprint.route("/create/<create_account_key>")
def create_account(create_account_key):
"""Checks the key. If valid, displays the create account page."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Invalid request. Please check your link and try again.")
return flask.redirect(flask.url_for("home"))
user_data = helpers.get_user_data(user_id)
if user_data is None:
flask.flash("An unexpected error occurred. Please contact DevTeam.")
return flask.redirect(flask.url_for("home"))
return flask.render_template(
"create_account.html", user_data=user_data, key=create_account_key)
@blueprint.route("/create/<create_account_key>/submit", methods=["POST"])
def <|fim_middle|>(create_account_key):
"""Handles a create account request."""
user_id = auth_utils.check_create_account_key(create_account_key)
if user_id is None:
# Key is invalid.
flask.current_app.logger.warn(
f'Invalid create_account_key: {create_account_key}')
flask.flash("Someone's been naughty.")
return flask.redirect(flask.url_for("home"))
username = flask.request.form.get("username", None)
password = flask.request.form.get("password", None)
password2 = flask.request.form.get("password2", None)
if username is None \
or password is None \
or password2 is None:
flask.current_app.logger.warn(
f'Invalid create account form for user ID {user_id}')
flask.flash("Invalid request.")
return flask.redirect(flask.url_for("home"))
if helpers.handle_create_account(user_id, username, password, password2):
flask.session['username'] = username
flask.current_app.logger.info(
f'Created account with username {username} for user ID {user_id}')
flask.flash("Account successfully created.")
return flask.redirect(flask.url_for("home"))
else:
# Flashes already handled.
return flask.redirect(
flask.url_for(
"account.create_account",
create_account_key=create_account_key))
<|fim▁end|> | create_account_submit |
<|file_name|>ui_role_tree.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""Test of tree output using Firefox."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(PauseAction(3000))
sequence.append(KeyComboAction("<Alt>b"))
sequence.append(KeyComboAction("Return"))
sequence.append(KeyComboAction("Tab"))
sequence.append(KeyComboAction("Tab"))
sequence.append(KeyComboAction("Up"))
sequence.append(KeyComboAction("Up"))
sequence.append(KeyComboAction("Up"))
sequence.append(KeyComboAction("Tab"))
sequence.append(PauseAction(3000))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("<Shift>Tab"))
sequence.append(utils.AssertPresentationAction(
"1. Shift Tab for tree",
["BRAILLE LINE: 'Firefox application Library frame All Bookmarks expanded TREE LEVEL 1'",
" VISIBLE: 'All Bookmarks expanded TREE LEVE', cursor=1",
"SPEECH OUTPUT: 'All Bookmarks.'",
"SPEECH OUTPUT: 'expanded.'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Down"))
sequence.append(utils.AssertPresentationAction(
"2. Down Arrow in tree",
["BRAILLE LINE: 'Firefox application Library frame Bookmarks Toolbar TREE LEVEL 2'",
" VISIBLE: 'Bookmarks Toolbar TREE LEVEL 2', cursor=1",
"SPEECH OUTPUT: 'Bookmarks Toolbar.'",
"SPEECH OUTPUT: 'tree level 2'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Down"))
sequence.append(utils.AssertPresentationAction(
"3. Down Arrow in tree",
["BRAILLE LINE: 'Firefox application Library frame Bookmarks Menu collapsed TREE LEVEL 2'",
" VISIBLE: 'Bookmarks Menu collapsed TREE LE', cursor=1",
"SPEECH OUTPUT: 'Bookmarks Menu.'",
"SPEECH OUTPUT: 'collapsed.'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("KP_Enter"))
sequence.append(utils.AssertPresentationAction(
"4. Basic Where Am I",
["BRAILLE LINE: 'Firefox application Library frame Bookmarks Menu collapsed TREE LEVEL 2'",
" VISIBLE: 'Bookmarks Menu collapsed TREE LE', cursor=1",
"SPEECH OUTPUT: 'Bookmarks Menu tree item.'",
"SPEECH OUTPUT: '2 of 3.'",
"SPEECH OUTPUT: 'collapsed tree level 2'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Right"))
sequence.append(utils.AssertPresentationAction(
"5. Right Arrow to expand folder",
["BRAILLE LINE: 'Firefox application Library frame Bookmarks Menu expanded TREE LEVEL 2'",
" VISIBLE: 'Bookmarks Menu expanded TREE LEV', cursor=1",
"SPEECH OUTPUT: 'expanded'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("KP_Enter"))
sequence.append(utils.AssertPresentationAction(
"6. Basic Where Am I",
["BRAILLE LINE: 'Firefox application Library frame Bookmarks Menu expanded TREE LEVEL 2'",
" VISIBLE: 'Bookmarks Menu expanded TREE LEV', cursor=1",
"SPEECH OUTPUT: 'Bookmarks Menu tree item.'",
"SPEECH OUTPUT: '2 of 3.'",
"SPEECH OUTPUT: 'expanded tree level 2'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Down"))
sequence.append(utils.AssertPresentationAction(
"7. Down Arrow in tree",
["BRAILLE LINE: 'Firefox application Library frame GNOME TREE LEVEL 3'",
" VISIBLE: 'GNOME TREE LEVEL 3', cursor=1",
"SPEECH OUTPUT: 'GNOME.'",
"SPEECH OUTPUT: 'tree level 3'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("KP_Enter"))
sequence.append(utils.AssertPresentationAction(
"8. Basic Where Am I",
["BRAILLE LINE: 'Firefox application Library frame GNOME TREE LEVEL 3'",
" VISIBLE: 'GNOME TREE LEVEL 3', cursor=1",
"SPEECH OUTPUT: 'GNOME tree item.'",
"SPEECH OUTPUT: '1 of 2.'",
"SPEECH OUTPUT: 'tree level 3'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Up"))
sequence.append(utils.AssertPresentationAction(
"9. Up Arrow in tree",
["BRAILLE LINE: 'Firefox application Library frame Bookmarks Menu expanded TREE LEVEL 2'",
" VISIBLE: 'Bookmarks Menu expanded TREE LEV', cursor=1",
"SPEECH OUTPUT: 'Bookmarks Menu.'",
"SPEECH OUTPUT: 'expanded.'",
"SPEECH OUTPUT: 'tree level 2'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Left"))
sequence.append(utils.AssertPresentationAction(
"10. Left Arrow to collapse folder",
["BRAILLE LINE: 'Firefox application Library frame Bookmarks Menu collapsed TREE LEVEL 2'",
" VISIBLE: 'Bookmarks Menu collapsed TREE LE', cursor=1",<|fim▁hole|>
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Up"))
sequence.append(utils.AssertPresentationAction(
"11. Up Arrow in tree",
["BRAILLE LINE: 'Firefox application Library frame Bookmarks Toolbar TREE LEVEL 2'",
" VISIBLE: 'Bookmarks Toolbar TREE LEVEL 2', cursor=1",
"SPEECH OUTPUT: 'Bookmarks Toolbar.'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Up"))
sequence.append(utils.AssertPresentationAction(
"12. Up Arrow in tree",
["BRAILLE LINE: 'Firefox application Library frame All Bookmarks expanded TREE LEVEL 1'",
" VISIBLE: 'All Bookmarks expanded TREE LEVE', cursor=1",
"SPEECH OUTPUT: 'All Bookmarks.'",
"SPEECH OUTPUT: 'expanded.'",
"SPEECH OUTPUT: 'tree level 1'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(utils.AssertPresentationAction(
"13. Tab back to tree table",
["BRAILLE LINE: 'Firefox application Library frame tree table Bookmarks Toolbar table row TREE LEVEL 1'",
" VISIBLE: 'Bookmarks Toolbar table row TR', cursor=1",
"SPEECH OUTPUT: 'Bookmarks Toolbar '"]))
sequence.append(KeyComboAction("<Alt>F4"))
sequence.append(utils.AssertionSummaryAction())
sequence.start()<|fim▁end|> | "SPEECH OUTPUT: 'collapsed'"])) |
<|file_name|>pxl_sprite.py<|end_file_name|><|fim▁begin|>from pxl_object import PxlObject
from pxl_vector import PxlVector
class PxlSprite(PxlObject):
def __init__(self, size, position):<|fim▁hole|> pass<|fim▁end|> | |
<|file_name|>pxl_sprite.py<|end_file_name|><|fim▁begin|>from pxl_object import PxlObject
from pxl_vector import PxlVector
class PxlSprite(PxlObject):
<|fim_middle|>
<|fim▁end|> | def __init__(self, size, position):
pass |
<|file_name|>pxl_sprite.py<|end_file_name|><|fim▁begin|>from pxl_object import PxlObject
from pxl_vector import PxlVector
class PxlSprite(PxlObject):
def __init__(self, size, position):
<|fim_middle|>
<|fim▁end|> | pass |
<|file_name|>pxl_sprite.py<|end_file_name|><|fim▁begin|>from pxl_object import PxlObject
from pxl_vector import PxlVector
class PxlSprite(PxlObject):
def <|fim_middle|>(self, size, position):
pass
<|fim▁end|> | __init__ |
<|file_name|>system.py<|end_file_name|><|fim▁begin|># coding: utf-8
# This file is part of Thomas Aquinas.
#
# Thomas Aquinas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Thomas Aquinas is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of<|fim▁hole|># You should have received a copy of the GNU General Public License
# along with Thomas Aquinas. If not, see <http://www.gnu.org/licenses/>.
#
# veni, Sancte Spiritus.
import ctypes
import logging<|fim▁end|> | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_('name'), max_length=200, unique=True)
objects = QueueManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_queue'
verbose_name = _('queue')
verbose_name_plural = _('queues')
class Message(models.Model):
visible = models.BooleanField(default=True, db_index=True)
sent_at = models.DateTimeField(null=True, blank=True, db_index=True,
auto_now_add=True)
payload = models.TextField(_('payload'), null=False)
queue = models.ForeignKey(Queue, related_name='messages')
objects = MessageManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_message'
verbose_name = _('message')<|fim▁hole|> verbose_name_plural = _('messages')<|fim▁end|> | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
<|fim_middle|>
class Message(models.Model):
visible = models.BooleanField(default=True, db_index=True)
sent_at = models.DateTimeField(null=True, blank=True, db_index=True,
auto_now_add=True)
payload = models.TextField(_('payload'), null=False)
queue = models.ForeignKey(Queue, related_name='messages')
objects = MessageManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_message'
verbose_name = _('message')
verbose_name_plural = _('messages')
<|fim▁end|> | name = models.CharField(_('name'), max_length=200, unique=True)
objects = QueueManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_queue'
verbose_name = _('queue')
verbose_name_plural = _('queues') |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_('name'), max_length=200, unique=True)
objects = QueueManager()
class Meta:
<|fim_middle|>
class Message(models.Model):
visible = models.BooleanField(default=True, db_index=True)
sent_at = models.DateTimeField(null=True, blank=True, db_index=True,
auto_now_add=True)
payload = models.TextField(_('payload'), null=False)
queue = models.ForeignKey(Queue, related_name='messages')
objects = MessageManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_message'
verbose_name = _('message')
verbose_name_plural = _('messages')
<|fim▁end|> | if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_queue'
verbose_name = _('queue')
verbose_name_plural = _('queues') |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_('name'), max_length=200, unique=True)
objects = QueueManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_queue'
verbose_name = _('queue')
verbose_name_plural = _('queues')
class Message(models.Model):
<|fim_middle|>
<|fim▁end|> | visible = models.BooleanField(default=True, db_index=True)
sent_at = models.DateTimeField(null=True, blank=True, db_index=True,
auto_now_add=True)
payload = models.TextField(_('payload'), null=False)
queue = models.ForeignKey(Queue, related_name='messages')
objects = MessageManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_message'
verbose_name = _('message')
verbose_name_plural = _('messages') |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_('name'), max_length=200, unique=True)
objects = QueueManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_queue'
verbose_name = _('queue')
verbose_name_plural = _('queues')
class Message(models.Model):
visible = models.BooleanField(default=True, db_index=True)
sent_at = models.DateTimeField(null=True, blank=True, db_index=True,
auto_now_add=True)
payload = models.TextField(_('payload'), null=False)
queue = models.ForeignKey(Queue, related_name='messages')
objects = MessageManager()
class Meta:
<|fim_middle|>
<|fim▁end|> | if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_message'
verbose_name = _('message')
verbose_name_plural = _('messages') |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_('name'), max_length=200, unique=True)
objects = QueueManager()
class Meta:
if django.VERSION >= (1, 7):
<|fim_middle|>
db_table = 'djkombu_queue'
verbose_name = _('queue')
verbose_name_plural = _('queues')
class Message(models.Model):
visible = models.BooleanField(default=True, db_index=True)
sent_at = models.DateTimeField(null=True, blank=True, db_index=True,
auto_now_add=True)
payload = models.TextField(_('payload'), null=False)
queue = models.ForeignKey(Queue, related_name='messages')
objects = MessageManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_message'
verbose_name = _('message')
verbose_name_plural = _('messages')
<|fim▁end|> | app_label = 'karellen_kombu_transport_django' |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .managers import QueueManager, MessageManager
class Queue(models.Model):
name = models.CharField(_('name'), max_length=200, unique=True)
objects = QueueManager()
class Meta:
if django.VERSION >= (1, 7):
app_label = 'karellen_kombu_transport_django'
db_table = 'djkombu_queue'
verbose_name = _('queue')
verbose_name_plural = _('queues')
class Message(models.Model):
visible = models.BooleanField(default=True, db_index=True)
sent_at = models.DateTimeField(null=True, blank=True, db_index=True,
auto_now_add=True)
payload = models.TextField(_('payload'), null=False)
queue = models.ForeignKey(Queue, related_name='messages')
objects = MessageManager()
class Meta:
if django.VERSION >= (1, 7):
<|fim_middle|>
db_table = 'djkombu_message'
verbose_name = _('message')
verbose_name_plural = _('messages')
<|fim▁end|> | app_label = 'karellen_kombu_transport_django' |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。<|fim▁hole|> def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")<|fim▁end|> | #
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"<|fim_middle|>
<|fim▁end|> |
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
|
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @<|fim_middle|>
t_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | return {str}
def _roo |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @retur<|fim_middle|>
t_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | n {str}
def _roo |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @retur<|fim_middle|>
ss_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | n {str}
def _cla |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param<|fim_middle|>
ram {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | {any} obj
# @pa |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return Lic<|fim_middle|>
ram {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | enseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @pa |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#<|fim_middle|>
ls.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> |
# @param {int} count 上限レコード数
# @return {saklient.cloud.mode |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @p<|fim_middle|>
通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | aram {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。 |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
<|fim_middle|>
ースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> |
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソ |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[<|fim_middle|>
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | ]} リソースオブジェクトの配列
|
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {s<|fim_middle|>
f with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | aklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
de |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.m<|fim_middle|>
del_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | odel_licenseinfo.Mo |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim_middle|>
<|fim▁end|> | |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim_middle|>
<|fim▁end|> | |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim_middle|>
<|fim▁end|> | |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
<|fim_middle|>@private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> |
## |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
<|fim_middle|>ate
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | ## @priv |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
<|fim_middle|>ate
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | ## @priv |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
<|fim_middle|>ate
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | ## @priv |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
<|fim_middle|>(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | Util.validate_type |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## <|fim_middle|>リストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | 次に取得する |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @<|fim_middle|> {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | param |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
<|fim_middle|>set(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | def re |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.lic<|fim_middle|>nfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | ensei |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @para<|fim_middle|>ame
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | m {str} n |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {sak<|fim_middle|>t.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim▁end|> | lien |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim_middle|><|fim▁end|> | |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim_middle|><|fim▁end|> | |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util import Util
import saklient
str = six.text_type
# module saklient.cloud.models.model_licenseinfo
class Model_LicenseInfo(Model):
## ライセンス種別情報を検索するための機能を備えたクラス。
## @private
# @return {str}
def _api_path(self):
return "/product/license"
## @private
# @return {str}
def _root_key(self):
return "LicenseInfo"
## @private
# @return {str}
def _root_key_m(self):
return "LicenseInfo"
## @private
# @return {str}
def _class_name(self):
return "LicenseInfo"
## @private
# @param {any} obj
# @param {bool} wrapped=False
# @return {saklient.cloud.resources.resource.Resource}
def _create_resource_impl(self, obj, wrapped=False):
Util.validate_type(wrapped, "bool")
return LicenseInfo(self._client, obj, wrapped)
## 次に取得するリストの開始オフセットを指定します。
#
# @param {int} offset オフセット
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def offset(self, offset):
Util.validate_type(offset, "int")
return self._offset(offset)
## 次に取得するリストの上限レコード数を指定します。
#
# @param {int} count 上限レコード数
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def limit(self, count):
Util.validate_type(count, "int")
return self._limit(count)
## Web APIのフィルタリング設定を直接指定します。
#
# @param {str} key キー
# @param {any} value 値
# @param {bool} multiple=False valueに配列を与え、OR条件で完全一致検索する場合にtrueを指定します。通常、valueはスカラ値であいまい検索されます。
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def filter_by(self, key, value, multiple=False):
Util.validate_type(key, "str")
Util.validate_type(multiple, "bool")
return self._filter_by(key, value, multiple)
## 次のリクエストのために設定されているステートをすべて破棄します。
#
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo} this
def reset(self):
return self._reset()
## 指定したIDを持つ唯一のリソースを取得します。
#
# @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str")
return self._get_by_id(id)
## リソースの検索リクエストを実行し、結果をリストで取得します。
#
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo[]} リソースオブジェクトの配列
def find(self):
return self._find()
## 指定した文字列を名前に含むリソースに絞り込みます。
#
# 大文字・小文字は区別されません。
# 半角スペースで区切られた複数の文字列は、それらをすべて含むことが条件とみなされます。
#
# @todo Implement test case
# @param {str} name
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def with_name_like(self, name):
Util.validate_type(name, "str")
return self._with_name_like(name)
## 名前でソートします。
#
# @todo Implement test case
# @param {bool} reverse=False
# @return {saklient.cloud.models.model_licenseinfo.Model_LicenseInfo}
def sort_by_name(self, reverse=False):
Util.validate_type(reverse, "bool")
return self._sort_by_name(reverse)
## @ignore
# @param {saklient.cloud.client.Client} client
def __init__(self, client):
super(Model_LicenseInfo, self).__init__(client)
Util.validate_type(client, "saklient.cloud.client.Client")
<|fim_middle|><|fim▁end|> | |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
def _get_priorities(self):
"""
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].sudo().get_param(
key, default='{}'))
# Catch exception to have a understandable error message
except (ValueError, SyntaxError):
raise exceptions.UserError(
_("Error to load the system parameter (%s) "
"of priorities") % key)
# As literal_eval can transform str into any format, check if we
# have a real dict
if not isinstance(priorities, dict):
raise exceptions.UserError(
_("Error to load the system parameter (%s) of priorities.\n"
"Invalid dictionary") % key)
return priorities
@api.multi
def send_mail(self, auto_commit=False):
"""
Set a priority on subsequent generated mail.mail, using priorities
set into the configuration.
:return: dict/action<|fim▁hole|> active_ids = self.env.context.get('active_ids')
default_priority = self.env.context.get('default_mail_job_priority')
if active_ids and not default_priority:
priorities = self._get_priorities()
size = len(active_ids)
limits = [lim for lim in priorities if lim <= size]
if limits:
prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio)
return super().send_mail(auto_commit=auto_commit)<|fim▁end|> | """ |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
<|fim_middle|>
<|fim▁end|> | _inherit = 'mail.compose.message'
@api.model
def _get_priorities(self):
"""
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].sudo().get_param(
key, default='{}'))
# Catch exception to have a understandable error message
except (ValueError, SyntaxError):
raise exceptions.UserError(
_("Error to load the system parameter (%s) "
"of priorities") % key)
# As literal_eval can transform str into any format, check if we
# have a real dict
if not isinstance(priorities, dict):
raise exceptions.UserError(
_("Error to load the system parameter (%s) of priorities.\n"
"Invalid dictionary") % key)
return priorities
@api.multi
def send_mail(self, auto_commit=False):
"""
Set a priority on subsequent generated mail.mail, using priorities
set into the configuration.
:return: dict/action
"""
active_ids = self.env.context.get('active_ids')
default_priority = self.env.context.get('default_mail_job_priority')
if active_ids and not default_priority:
priorities = self._get_priorities()
size = len(active_ids)
limits = [lim for lim in priorities if lim <= size]
if limits:
prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio)
return super().send_mail(auto_commit=auto_commit) |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
def _get_priorities(self):
<|fim_middle|>
@api.multi
def send_mail(self, auto_commit=False):
"""
Set a priority on subsequent generated mail.mail, using priorities
set into the configuration.
:return: dict/action
"""
active_ids = self.env.context.get('active_ids')
default_priority = self.env.context.get('default_mail_job_priority')
if active_ids and not default_priority:
priorities = self._get_priorities()
size = len(active_ids)
limits = [lim for lim in priorities if lim <= size]
if limits:
prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio)
return super().send_mail(auto_commit=auto_commit)
<|fim▁end|> | """
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].sudo().get_param(
key, default='{}'))
# Catch exception to have a understandable error message
except (ValueError, SyntaxError):
raise exceptions.UserError(
_("Error to load the system parameter (%s) "
"of priorities") % key)
# As literal_eval can transform str into any format, check if we
# have a real dict
if not isinstance(priorities, dict):
raise exceptions.UserError(
_("Error to load the system parameter (%s) of priorities.\n"
"Invalid dictionary") % key)
return priorities |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
def _get_priorities(self):
"""
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].sudo().get_param(
key, default='{}'))
# Catch exception to have a understandable error message
except (ValueError, SyntaxError):
raise exceptions.UserError(
_("Error to load the system parameter (%s) "
"of priorities") % key)
# As literal_eval can transform str into any format, check if we
# have a real dict
if not isinstance(priorities, dict):
raise exceptions.UserError(
_("Error to load the system parameter (%s) of priorities.\n"
"Invalid dictionary") % key)
return priorities
@api.multi
def send_mail(self, auto_commit=False):
<|fim_middle|>
<|fim▁end|> | """
Set a priority on subsequent generated mail.mail, using priorities
set into the configuration.
:return: dict/action
"""
active_ids = self.env.context.get('active_ids')
default_priority = self.env.context.get('default_mail_job_priority')
if active_ids and not default_priority:
priorities = self._get_priorities()
size = len(active_ids)
limits = [lim for lim in priorities if lim <= size]
if limits:
prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio)
return super().send_mail(auto_commit=auto_commit) |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
def _get_priorities(self):
"""
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].sudo().get_param(
key, default='{}'))
# Catch exception to have a understandable error message
except (ValueError, SyntaxError):
raise exceptions.UserError(
_("Error to load the system parameter (%s) "
"of priorities") % key)
# As literal_eval can transform str into any format, check if we
# have a real dict
if not isinstance(priorities, dict):
<|fim_middle|>
return priorities
@api.multi
def send_mail(self, auto_commit=False):
"""
Set a priority on subsequent generated mail.mail, using priorities
set into the configuration.
:return: dict/action
"""
active_ids = self.env.context.get('active_ids')
default_priority = self.env.context.get('default_mail_job_priority')
if active_ids and not default_priority:
priorities = self._get_priorities()
size = len(active_ids)
limits = [lim for lim in priorities if lim <= size]
if limits:
prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio)
return super().send_mail(auto_commit=auto_commit)
<|fim▁end|> | raise exceptions.UserError(
_("Error to load the system parameter (%s) of priorities.\n"
"Invalid dictionary") % key) |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
def _get_priorities(self):
"""
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].sudo().get_param(
key, default='{}'))
# Catch exception to have a understandable error message
except (ValueError, SyntaxError):
raise exceptions.UserError(
_("Error to load the system parameter (%s) "
"of priorities") % key)
# As literal_eval can transform str into any format, check if we
# have a real dict
if not isinstance(priorities, dict):
raise exceptions.UserError(
_("Error to load the system parameter (%s) of priorities.\n"
"Invalid dictionary") % key)
return priorities
@api.multi
def send_mail(self, auto_commit=False):
"""
Set a priority on subsequent generated mail.mail, using priorities
set into the configuration.
:return: dict/action
"""
active_ids = self.env.context.get('active_ids')
default_priority = self.env.context.get('default_mail_job_priority')
if active_ids and not default_priority:
<|fim_middle|>
return super().send_mail(auto_commit=auto_commit)
<|fim▁end|> | priorities = self._get_priorities()
size = len(active_ids)
limits = [lim for lim in priorities if lim <= size]
if limits:
prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio) |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
def _get_priorities(self):
"""
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].sudo().get_param(
key, default='{}'))
# Catch exception to have a understandable error message
except (ValueError, SyntaxError):
raise exceptions.UserError(
_("Error to load the system parameter (%s) "
"of priorities") % key)
# As literal_eval can transform str into any format, check if we
# have a real dict
if not isinstance(priorities, dict):
raise exceptions.UserError(
_("Error to load the system parameter (%s) of priorities.\n"
"Invalid dictionary") % key)
return priorities
@api.multi
def send_mail(self, auto_commit=False):
"""
Set a priority on subsequent generated mail.mail, using priorities
set into the configuration.
:return: dict/action
"""
active_ids = self.env.context.get('active_ids')
default_priority = self.env.context.get('default_mail_job_priority')
if active_ids and not default_priority:
priorities = self._get_priorities()
size = len(active_ids)
limits = [lim for lim in priorities if lim <= size]
if limits:
<|fim_middle|>
return super().send_mail(auto_commit=auto_commit)
<|fim▁end|> | prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio) |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
def <|fim_middle|>(self):
"""
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].sudo().get_param(
key, default='{}'))
# Catch exception to have a understandable error message
except (ValueError, SyntaxError):
raise exceptions.UserError(
_("Error to load the system parameter (%s) "
"of priorities") % key)
# As literal_eval can transform str into any format, check if we
# have a real dict
if not isinstance(priorities, dict):
raise exceptions.UserError(
_("Error to load the system parameter (%s) of priorities.\n"
"Invalid dictionary") % key)
return priorities
@api.multi
def send_mail(self, auto_commit=False):
"""
Set a priority on subsequent generated mail.mail, using priorities
set into the configuration.
:return: dict/action
"""
active_ids = self.env.context.get('active_ids')
default_priority = self.env.context.get('default_mail_job_priority')
if active_ids and not default_priority:
priorities = self._get_priorities()
size = len(active_ids)
limits = [lim for lim in priorities if lim <= size]
if limits:
prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio)
return super().send_mail(auto_commit=auto_commit)
<|fim▁end|> | _get_priorities |
<|file_name|>mail_compose_message.py<|end_file_name|><|fim▁begin|># Copyright 2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import ast
from odoo import api, exceptions, models, _
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
@api.model
def _get_priorities(self):
"""
Load priorities from parameters.
:return: dict
"""
key = 'mail.sending.job.priorities'
try:
priorities = ast.literal_eval(
self.env['ir.config_parameter'].sudo().get_param(
key, default='{}'))
# Catch exception to have a understandable error message
except (ValueError, SyntaxError):
raise exceptions.UserError(
_("Error to load the system parameter (%s) "
"of priorities") % key)
# As literal_eval can transform str into any format, check if we
# have a real dict
if not isinstance(priorities, dict):
raise exceptions.UserError(
_("Error to load the system parameter (%s) of priorities.\n"
"Invalid dictionary") % key)
return priorities
@api.multi
def <|fim_middle|>(self, auto_commit=False):
"""
Set a priority on subsequent generated mail.mail, using priorities
set into the configuration.
:return: dict/action
"""
active_ids = self.env.context.get('active_ids')
default_priority = self.env.context.get('default_mail_job_priority')
if active_ids and not default_priority:
priorities = self._get_priorities()
size = len(active_ids)
limits = [lim for lim in priorities if lim <= size]
if limits:
prio = priorities.get(max(limits))
self = self.with_context(default_mail_job_priority=prio)
return super().send_mail(auto_commit=auto_commit)
<|fim▁end|> | send_mail |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
<|fim▁hole|>https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix) where the email address configured in
EMAIL_GATEWAY_PATTERN delivers emails directly to Zulip, and this, a
cron job that connects to an IMAP inbox (which receives the emails)
periodically.
Run this in a cronjob every N minutes if you have configured Zulip to
poll an external IMAP mailbox for messages. The script will then
connect to your IMAP server and batch-process all messages.
We extract and validate the target stream from information in the
recipient address and retrieve, forward, and archive the message.
"""
import email
import email.policy
import logging
from email.message import EmailMessage
from imaplib import IMAP4_SSL
from typing import Any, Generator
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from zerver.lib.email_mirror import logger, process_message
## Setup ##
log_format = "%(asctime)s: %(message)s"
logging.basicConfig(format=log_format)
formatter = logging.Formatter(log_format)
file_handler = logging.FileHandler(settings.EMAIL_MIRROR_LOG_PATH)
file_handler.setFormatter(formatter)
logger.setLevel(logging.DEBUG)
logger.addHandler(file_handler)
def get_imap_messages() -> Generator[EmailMessage, None, None]:
mbox = IMAP4_SSL(settings.EMAIL_GATEWAY_IMAP_SERVER, settings.EMAIL_GATEWAY_IMAP_PORT)
mbox.login(settings.EMAIL_GATEWAY_LOGIN, settings.EMAIL_GATEWAY_PASSWORD)
try:
mbox.select(settings.EMAIL_GATEWAY_IMAP_FOLDER)
try:
status, num_ids_data = mbox.search(None, 'ALL')
for message_id in num_ids_data[0].split():
status, msg_data = mbox.fetch(message_id, '(RFC822)')
assert isinstance(msg_data[0], tuple)
msg_as_bytes = msg_data[0][1]
message = email.message_from_bytes(msg_as_bytes, policy=email.policy.default)
# https://github.com/python/typeshed/issues/2417
assert isinstance(message, EmailMessage)
yield message
mbox.store(message_id, '+FLAGS', '\\Deleted')
mbox.expunge()
finally:
mbox.close()
finally:
mbox.logout()
class Command(BaseCommand):
help = __doc__
def handle(self, *args: Any, **options: str) -> None:
# We're probably running from cron, try to batch-process mail
if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER or
not settings.EMAIL_GATEWAY_IMAP_PORT or not settings.EMAIL_GATEWAY_IMAP_FOLDER):
raise CommandError("Please configure the email mirror gateway in /etc/zulip/, "
"or specify $ORIGINAL_RECIPIENT if piping a single mail.")
for message in get_imap_messages():
process_message(message)<|fim▁end|> | |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix) where the email address configured in
EMAIL_GATEWAY_PATTERN delivers emails directly to Zulip, and this, a
cron job that connects to an IMAP inbox (which receives the emails)
periodically.
Run this in a cronjob every N minutes if you have configured Zulip to
poll an external IMAP mailbox for messages. The script will then
connect to your IMAP server and batch-process all messages.
We extract and validate the target stream from information in the
recipient address and retrieve, forward, and archive the message.
"""
import email
import email.policy
import logging
from email.message import EmailMessage
from imaplib import IMAP4_SSL
from typing import Any, Generator
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from zerver.lib.email_mirror import logger, process_message
## Setup ##
log_format = "%(asctime)s: %(message)s"
logging.basicConfig(format=log_format)
formatter = logging.Formatter(log_format)
file_handler = logging.FileHandler(settings.EMAIL_MIRROR_LOG_PATH)
file_handler.setFormatter(formatter)
logger.setLevel(logging.DEBUG)
logger.addHandler(file_handler)
def get_imap_messages() -> Generator[EmailMessage, None, None]:
<|fim_middle|>
class Command(BaseCommand):
help = __doc__
def handle(self, *args: Any, **options: str) -> None:
# We're probably running from cron, try to batch-process mail
if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER or
not settings.EMAIL_GATEWAY_IMAP_PORT or not settings.EMAIL_GATEWAY_IMAP_FOLDER):
raise CommandError("Please configure the email mirror gateway in /etc/zulip/, "
"or specify $ORIGINAL_RECIPIENT if piping a single mail.")
for message in get_imap_messages():
process_message(message)
<|fim▁end|> | mbox = IMAP4_SSL(settings.EMAIL_GATEWAY_IMAP_SERVER, settings.EMAIL_GATEWAY_IMAP_PORT)
mbox.login(settings.EMAIL_GATEWAY_LOGIN, settings.EMAIL_GATEWAY_PASSWORD)
try:
mbox.select(settings.EMAIL_GATEWAY_IMAP_FOLDER)
try:
status, num_ids_data = mbox.search(None, 'ALL')
for message_id in num_ids_data[0].split():
status, msg_data = mbox.fetch(message_id, '(RFC822)')
assert isinstance(msg_data[0], tuple)
msg_as_bytes = msg_data[0][1]
message = email.message_from_bytes(msg_as_bytes, policy=email.policy.default)
# https://github.com/python/typeshed/issues/2417
assert isinstance(message, EmailMessage)
yield message
mbox.store(message_id, '+FLAGS', '\\Deleted')
mbox.expunge()
finally:
mbox.close()
finally:
mbox.logout() |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix) where the email address configured in
EMAIL_GATEWAY_PATTERN delivers emails directly to Zulip, and this, a
cron job that connects to an IMAP inbox (which receives the emails)
periodically.
Run this in a cronjob every N minutes if you have configured Zulip to
poll an external IMAP mailbox for messages. The script will then
connect to your IMAP server and batch-process all messages.
We extract and validate the target stream from information in the
recipient address and retrieve, forward, and archive the message.
"""
import email
import email.policy
import logging
from email.message import EmailMessage
from imaplib import IMAP4_SSL
from typing import Any, Generator
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from zerver.lib.email_mirror import logger, process_message
## Setup ##
log_format = "%(asctime)s: %(message)s"
logging.basicConfig(format=log_format)
formatter = logging.Formatter(log_format)
file_handler = logging.FileHandler(settings.EMAIL_MIRROR_LOG_PATH)
file_handler.setFormatter(formatter)
logger.setLevel(logging.DEBUG)
logger.addHandler(file_handler)
def get_imap_messages() -> Generator[EmailMessage, None, None]:
mbox = IMAP4_SSL(settings.EMAIL_GATEWAY_IMAP_SERVER, settings.EMAIL_GATEWAY_IMAP_PORT)
mbox.login(settings.EMAIL_GATEWAY_LOGIN, settings.EMAIL_GATEWAY_PASSWORD)
try:
mbox.select(settings.EMAIL_GATEWAY_IMAP_FOLDER)
try:
status, num_ids_data = mbox.search(None, 'ALL')
for message_id in num_ids_data[0].split():
status, msg_data = mbox.fetch(message_id, '(RFC822)')
assert isinstance(msg_data[0], tuple)
msg_as_bytes = msg_data[0][1]
message = email.message_from_bytes(msg_as_bytes, policy=email.policy.default)
# https://github.com/python/typeshed/issues/2417
assert isinstance(message, EmailMessage)
yield message
mbox.store(message_id, '+FLAGS', '\\Deleted')
mbox.expunge()
finally:
mbox.close()
finally:
mbox.logout()
class Command(BaseCommand):
<|fim_middle|>
<|fim▁end|> | help = __doc__
def handle(self, *args: Any, **options: str) -> None:
# We're probably running from cron, try to batch-process mail
if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER or
not settings.EMAIL_GATEWAY_IMAP_PORT or not settings.EMAIL_GATEWAY_IMAP_FOLDER):
raise CommandError("Please configure the email mirror gateway in /etc/zulip/, "
"or specify $ORIGINAL_RECIPIENT if piping a single mail.")
for message in get_imap_messages():
process_message(message) |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix) where the email address configured in
EMAIL_GATEWAY_PATTERN delivers emails directly to Zulip, and this, a
cron job that connects to an IMAP inbox (which receives the emails)
periodically.
Run this in a cronjob every N minutes if you have configured Zulip to
poll an external IMAP mailbox for messages. The script will then
connect to your IMAP server and batch-process all messages.
We extract and validate the target stream from information in the
recipient address and retrieve, forward, and archive the message.
"""
import email
import email.policy
import logging
from email.message import EmailMessage
from imaplib import IMAP4_SSL
from typing import Any, Generator
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from zerver.lib.email_mirror import logger, process_message
## Setup ##
log_format = "%(asctime)s: %(message)s"
logging.basicConfig(format=log_format)
formatter = logging.Formatter(log_format)
file_handler = logging.FileHandler(settings.EMAIL_MIRROR_LOG_PATH)
file_handler.setFormatter(formatter)
logger.setLevel(logging.DEBUG)
logger.addHandler(file_handler)
def get_imap_messages() -> Generator[EmailMessage, None, None]:
mbox = IMAP4_SSL(settings.EMAIL_GATEWAY_IMAP_SERVER, settings.EMAIL_GATEWAY_IMAP_PORT)
mbox.login(settings.EMAIL_GATEWAY_LOGIN, settings.EMAIL_GATEWAY_PASSWORD)
try:
mbox.select(settings.EMAIL_GATEWAY_IMAP_FOLDER)
try:
status, num_ids_data = mbox.search(None, 'ALL')
for message_id in num_ids_data[0].split():
status, msg_data = mbox.fetch(message_id, '(RFC822)')
assert isinstance(msg_data[0], tuple)
msg_as_bytes = msg_data[0][1]
message = email.message_from_bytes(msg_as_bytes, policy=email.policy.default)
# https://github.com/python/typeshed/issues/2417
assert isinstance(message, EmailMessage)
yield message
mbox.store(message_id, '+FLAGS', '\\Deleted')
mbox.expunge()
finally:
mbox.close()
finally:
mbox.logout()
class Command(BaseCommand):
help = __doc__
def handle(self, *args: Any, **options: str) -> None:
# We're probably running from cron, try to batch-process mail
<|fim_middle|>
<|fim▁end|> | if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER or
not settings.EMAIL_GATEWAY_IMAP_PORT or not settings.EMAIL_GATEWAY_IMAP_FOLDER):
raise CommandError("Please configure the email mirror gateway in /etc/zulip/, "
"or specify $ORIGINAL_RECIPIENT if piping a single mail.")
for message in get_imap_messages():
process_message(message) |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix) where the email address configured in
EMAIL_GATEWAY_PATTERN delivers emails directly to Zulip, and this, a
cron job that connects to an IMAP inbox (which receives the emails)
periodically.
Run this in a cronjob every N minutes if you have configured Zulip to
poll an external IMAP mailbox for messages. The script will then
connect to your IMAP server and batch-process all messages.
We extract and validate the target stream from information in the
recipient address and retrieve, forward, and archive the message.
"""
import email
import email.policy
import logging
from email.message import EmailMessage
from imaplib import IMAP4_SSL
from typing import Any, Generator
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from zerver.lib.email_mirror import logger, process_message
## Setup ##
log_format = "%(asctime)s: %(message)s"
logging.basicConfig(format=log_format)
formatter = logging.Formatter(log_format)
file_handler = logging.FileHandler(settings.EMAIL_MIRROR_LOG_PATH)
file_handler.setFormatter(formatter)
logger.setLevel(logging.DEBUG)
logger.addHandler(file_handler)
def get_imap_messages() -> Generator[EmailMessage, None, None]:
mbox = IMAP4_SSL(settings.EMAIL_GATEWAY_IMAP_SERVER, settings.EMAIL_GATEWAY_IMAP_PORT)
mbox.login(settings.EMAIL_GATEWAY_LOGIN, settings.EMAIL_GATEWAY_PASSWORD)
try:
mbox.select(settings.EMAIL_GATEWAY_IMAP_FOLDER)
try:
status, num_ids_data = mbox.search(None, 'ALL')
for message_id in num_ids_data[0].split():
status, msg_data = mbox.fetch(message_id, '(RFC822)')
assert isinstance(msg_data[0], tuple)
msg_as_bytes = msg_data[0][1]
message = email.message_from_bytes(msg_as_bytes, policy=email.policy.default)
# https://github.com/python/typeshed/issues/2417
assert isinstance(message, EmailMessage)
yield message
mbox.store(message_id, '+FLAGS', '\\Deleted')
mbox.expunge()
finally:
mbox.close()
finally:
mbox.logout()
class Command(BaseCommand):
help = __doc__
def handle(self, *args: Any, **options: str) -> None:
# We're probably running from cron, try to batch-process mail
if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER or
not settings.EMAIL_GATEWAY_IMAP_PORT or not settings.EMAIL_GATEWAY_IMAP_FOLDER):
<|fim_middle|>
for message in get_imap_messages():
process_message(message)
<|fim▁end|> | raise CommandError("Please configure the email mirror gateway in /etc/zulip/, "
"or specify $ORIGINAL_RECIPIENT if piping a single mail.") |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix) where the email address configured in
EMAIL_GATEWAY_PATTERN delivers emails directly to Zulip, and this, a
cron job that connects to an IMAP inbox (which receives the emails)
periodically.
Run this in a cronjob every N minutes if you have configured Zulip to
poll an external IMAP mailbox for messages. The script will then
connect to your IMAP server and batch-process all messages.
We extract and validate the target stream from information in the
recipient address and retrieve, forward, and archive the message.
"""
import email
import email.policy
import logging
from email.message import EmailMessage
from imaplib import IMAP4_SSL
from typing import Any, Generator
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from zerver.lib.email_mirror import logger, process_message
## Setup ##
log_format = "%(asctime)s: %(message)s"
logging.basicConfig(format=log_format)
formatter = logging.Formatter(log_format)
file_handler = logging.FileHandler(settings.EMAIL_MIRROR_LOG_PATH)
file_handler.setFormatter(formatter)
logger.setLevel(logging.DEBUG)
logger.addHandler(file_handler)
def <|fim_middle|>() -> Generator[EmailMessage, None, None]:
mbox = IMAP4_SSL(settings.EMAIL_GATEWAY_IMAP_SERVER, settings.EMAIL_GATEWAY_IMAP_PORT)
mbox.login(settings.EMAIL_GATEWAY_LOGIN, settings.EMAIL_GATEWAY_PASSWORD)
try:
mbox.select(settings.EMAIL_GATEWAY_IMAP_FOLDER)
try:
status, num_ids_data = mbox.search(None, 'ALL')
for message_id in num_ids_data[0].split():
status, msg_data = mbox.fetch(message_id, '(RFC822)')
assert isinstance(msg_data[0], tuple)
msg_as_bytes = msg_data[0][1]
message = email.message_from_bytes(msg_as_bytes, policy=email.policy.default)
# https://github.com/python/typeshed/issues/2417
assert isinstance(message, EmailMessage)
yield message
mbox.store(message_id, '+FLAGS', '\\Deleted')
mbox.expunge()
finally:
mbox.close()
finally:
mbox.logout()
class Command(BaseCommand):
help = __doc__
def handle(self, *args: Any, **options: str) -> None:
# We're probably running from cron, try to batch-process mail
if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER or
not settings.EMAIL_GATEWAY_IMAP_PORT or not settings.EMAIL_GATEWAY_IMAP_FOLDER):
raise CommandError("Please configure the email mirror gateway in /etc/zulip/, "
"or specify $ORIGINAL_RECIPIENT if piping a single mail.")
for message in get_imap_messages():
process_message(message)
<|fim▁end|> | get_imap_messages |
<|file_name|>email_mirror.py<|end_file_name|><|fim▁begin|>"""Cron job implementation of Zulip's incoming email gateway's helper
for forwarding emails into Zulip.
https://zulip.readthedocs.io/en/latest/production/email-gateway.html
The email gateway supports two major modes of operation: An email
server (using postfix) where the email address configured in
EMAIL_GATEWAY_PATTERN delivers emails directly to Zulip, and this, a
cron job that connects to an IMAP inbox (which receives the emails)
periodically.
Run this in a cronjob every N minutes if you have configured Zulip to
poll an external IMAP mailbox for messages. The script will then
connect to your IMAP server and batch-process all messages.
We extract and validate the target stream from information in the
recipient address and retrieve, forward, and archive the message.
"""
import email
import email.policy
import logging
from email.message import EmailMessage
from imaplib import IMAP4_SSL
from typing import Any, Generator
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from zerver.lib.email_mirror import logger, process_message
## Setup ##
log_format = "%(asctime)s: %(message)s"
logging.basicConfig(format=log_format)
formatter = logging.Formatter(log_format)
file_handler = logging.FileHandler(settings.EMAIL_MIRROR_LOG_PATH)
file_handler.setFormatter(formatter)
logger.setLevel(logging.DEBUG)
logger.addHandler(file_handler)
def get_imap_messages() -> Generator[EmailMessage, None, None]:
mbox = IMAP4_SSL(settings.EMAIL_GATEWAY_IMAP_SERVER, settings.EMAIL_GATEWAY_IMAP_PORT)
mbox.login(settings.EMAIL_GATEWAY_LOGIN, settings.EMAIL_GATEWAY_PASSWORD)
try:
mbox.select(settings.EMAIL_GATEWAY_IMAP_FOLDER)
try:
status, num_ids_data = mbox.search(None, 'ALL')
for message_id in num_ids_data[0].split():
status, msg_data = mbox.fetch(message_id, '(RFC822)')
assert isinstance(msg_data[0], tuple)
msg_as_bytes = msg_data[0][1]
message = email.message_from_bytes(msg_as_bytes, policy=email.policy.default)
# https://github.com/python/typeshed/issues/2417
assert isinstance(message, EmailMessage)
yield message
mbox.store(message_id, '+FLAGS', '\\Deleted')
mbox.expunge()
finally:
mbox.close()
finally:
mbox.logout()
class Command(BaseCommand):
help = __doc__
def <|fim_middle|>(self, *args: Any, **options: str) -> None:
# We're probably running from cron, try to batch-process mail
if (not settings.EMAIL_GATEWAY_BOT or not settings.EMAIL_GATEWAY_LOGIN or
not settings.EMAIL_GATEWAY_PASSWORD or not settings.EMAIL_GATEWAY_IMAP_SERVER or
not settings.EMAIL_GATEWAY_IMAP_PORT or not settings.EMAIL_GATEWAY_IMAP_FOLDER):
raise CommandError("Please configure the email mirror gateway in /etc/zulip/, "
"or specify $ORIGINAL_RECIPIENT if piping a single mail.")
for message in get_imap_messages():
process_message(message)
<|fim▁end|> | handle |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
<|fim▁hole|> import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
unittest.main()<|fim▁end|> | if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else: |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
<|fim_middle|>
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | """This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video) |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
<|fim_middle|>
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
} |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
<|fim_middle|>
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict()) |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
<|fim_middle|>
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json())) |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
<|fim_middle|>
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video) |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
<|fim_middle|>
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | import unittest2 as unittest |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
<|fim_middle|>
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | import unittest |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
<|fim_middle|>
<|fim▁end|> | unittest.main() |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def <|fim_middle|>(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | setUp |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def <|fim_middle|>(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | test_video_de_json |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def <|fim_middle|>(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def test_video_to_dict(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | test_video_to_json |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains a object that represents Tests for Telegram
InlineQueryResultVideo"""
import sys
if sys.version_info[0:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
sys.path.append('.')
import telegram
from tests.base import BaseTest
class InlineQueryResultVideoTest(BaseTest, unittest.TestCase):
"""This object represents Tests for Telegram InlineQueryResultVideo."""
def setUp(self):
self.id = 'id'
self.type = 'video'
self.video_url = 'video url'
self.mime_type = 'mime type'
self.video_width = 10
self.video_height = 15
self.video_duration = 15
self.thumb_url = 'thumb url'
self.title = 'title'
self.caption = 'caption'
self.description = 'description'
self.input_message_content = telegram.InputTextMessageContent('input_message_content')
self.reply_markup = telegram.InlineKeyboardMarkup([[
telegram.InlineKeyboardButton('reply_markup')
]])
self.json_dict = {
'type': self.type,
'id': self.id,
'video_url': self.video_url,
'mime_type': self.mime_type,
'video_width': self.video_width,
'video_height': self.video_height,
'video_duration': self.video_duration,
'thumb_url': self.thumb_url,
'title': self.title,
'caption': self.caption,
'description': self.description,
'input_message_content': self.input_message_content.to_dict(),
'reply_markup': self.reply_markup.to_dict(),
}
def test_video_de_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertEqual(video.type, self.type)
self.assertEqual(video.id, self.id)
self.assertEqual(video.video_url, self.video_url)
self.assertEqual(video.mime_type, self.mime_type)
self.assertEqual(video.video_width, self.video_width)
self.assertEqual(video.video_height, self.video_height)
self.assertEqual(video.video_duration, self.video_duration)
self.assertEqual(video.thumb_url, self.thumb_url)
self.assertEqual(video.title, self.title)
self.assertEqual(video.description, self.description)
self.assertEqual(video.caption, self.caption)
self.assertDictEqual(video.input_message_content.to_dict(),
self.input_message_content.to_dict())
self.assertDictEqual(video.reply_markup.to_dict(), self.reply_markup.to_dict())
def test_video_to_json(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict)
self.assertTrue(self.is_json(video.to_json()))
def <|fim_middle|>(self):
video = telegram.InlineQueryResultVideo.de_json(self.json_dict).to_dict()
self.assertTrue(self.is_dict(video))
self.assertDictEqual(self.json_dict, video)
if __name__ == '__main__':
unittest.main()
<|fim▁end|> | test_video_to_dict |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
scheme='http',
port=9200,
http_compress=True)
# test if it works
if not silent and not es_client.cat.health(request_timeout=30):
raise ValueError('Credentials do not work for Elastic search')
return es_client
def get_index_config(lang):
"""
Returns the elasticsearch index configuration.
Configures the analysers based on the language passed in.
"""
return {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
'mappings': {
'_doc': {
'properties': {
'title': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'content': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]<|fim▁hole|> 'author': {
'type': 'keyword'
},
'source': {
'type': 'keyword'
},
'argument_score': {
'type': 'float'
}
}
}
}
}<|fim▁end|> | },
'url': {'type': 'text'},
'title_plain': {'type': 'text'},
'content_plain': {'type': 'text'}, |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
<|fim_middle|>
def get_index_config(lang):
"""
Returns the elasticsearch index configuration.
Configures the analysers based on the language passed in.
"""
return {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
'mappings': {
'_doc': {
'properties': {
'title': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'content': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'url': {'type': 'text'},
'title_plain': {'type': 'text'},
'content_plain': {'type': 'text'},
'author': {
'type': 'keyword'
},
'source': {
'type': 'keyword'
},
'argument_score': {
'type': 'float'
}
}
}
}
}
<|fim▁end|> | """
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
scheme='http',
port=9200,
http_compress=True)
# test if it works
if not silent and not es_client.cat.health(request_timeout=30):
raise ValueError('Credentials do not work for Elastic search')
return es_client |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
scheme='http',
port=9200,
http_compress=True)
# test if it works
if not silent and not es_client.cat.health(request_timeout=30):
raise ValueError('Credentials do not work for Elastic search')
return es_client
def get_index_config(lang):
<|fim_middle|>
<|fim▁end|> | """
Returns the elasticsearch index configuration.
Configures the analysers based on the language passed in.
"""
return {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
'mappings': {
'_doc': {
'properties': {
'title': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'content': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'url': {'type': 'text'},
'title_plain': {'type': 'text'},
'content_plain': {'type': 'text'},
'author': {
'type': 'keyword'
},
'source': {
'type': 'keyword'
},
'argument_score': {
'type': 'float'
}
}
}
}
} |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
scheme='http',
port=9200,
http_compress=True)
# test if it works
if not silent and not es_client.cat.health(request_timeout=30):
<|fim_middle|>
return es_client
def get_index_config(lang):
"""
Returns the elasticsearch index configuration.
Configures the analysers based on the language passed in.
"""
return {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
'mappings': {
'_doc': {
'properties': {
'title': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'content': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'url': {'type': 'text'},
'title_plain': {'type': 'text'},
'content_plain': {'type': 'text'},
'author': {
'type': 'keyword'
},
'source': {
'type': 'keyword'
},
'argument_score': {
'type': 'float'
}
}
}
}
}
<|fim▁end|> | raise ValueError('Credentials do not work for Elastic search') |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def <|fim_middle|>(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
scheme='http',
port=9200,
http_compress=True)
# test if it works
if not silent and not es_client.cat.health(request_timeout=30):
raise ValueError('Credentials do not work for Elastic search')
return es_client
def get_index_config(lang):
"""
Returns the elasticsearch index configuration.
Configures the analysers based on the language passed in.
"""
return {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
'mappings': {
'_doc': {
'properties': {
'title': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'content': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'url': {'type': 'text'},
'title_plain': {'type': 'text'},
'content_plain': {'type': 'text'},
'author': {
'type': 'keyword'
},
'source': {
'type': 'keyword'
},
'argument_score': {
'type': 'float'
}
}
}
}
}
<|fim▁end|> | get_es_client |
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>from elasticsearch import Elasticsearch
from django.conf import settings
def get_es_client(silent=False):
"""
Returns the elasticsearch client which uses the configuration file
"""
es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
scheme='http',
port=9200,
http_compress=True)
# test if it works
if not silent and not es_client.cat.health(request_timeout=30):
raise ValueError('Credentials do not work for Elastic search')
return es_client
def <|fim_middle|>(lang):
"""
Returns the elasticsearch index configuration.
Configures the analysers based on the language passed in.
"""
return {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
'mappings': {
'_doc': {
'properties': {
'title': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'content': {
'type': 'text',
'analyzer': settings.ELASTIC_SEARCH_ANALYSERS[lang]
},
'url': {'type': 'text'},
'title_plain': {'type': 'text'},
'content_plain': {'type': 'text'},
'author': {
'type': 'keyword'
},
'source': {
'type': 'keyword'
},
'argument_score': {
'type': 'float'
}
}
}
}
}
<|fim▁end|> | get_index_config |
<|file_name|>cpu.py<|end_file_name|><|fim▁begin|># (void)walker hardware platform support
# Copyright (C) 2012-2013 David Holm <[email protected]>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import abc
from ..utils import OrderedDict
from ..utils import enum
Architecture = enum('Test', 'X86', 'X8664', 'Mips', 'Arm', 'Generic',
enum_type='Architecture')
class Register(object):
_register_fmt = {16: '0x%032lX',<|fim▁hole|> 4: '0x%08lX',
2: '0x%04lX',
1: '0x%02lX'}
def __init__(self, name):
self._name = name
def name(self):
return self._name
def size(self):
raise NotImplementedError
def value(self):
raise NotImplementedError
def str(self):
if self.value() is not None:
return self._register_fmt[self.size()] % self.value()
chars_per_byte = 2
return ''.join(['-' * (self.size() * chars_per_byte)])
def create_static_register(register):
class StaticRegister(type(register), object):
def __init__(self, name):
super(StaticRegister, self).__init__(name)
self._size = register.size()
self._value = register.value()
def size(self):
return self._size
def value(self):
return self._value
return StaticRegister(register.name())
class Cpu(object):
__metaclass__ = abc.ABCMeta
def __init__(self, cpu_factory, registers):
self._registers = OrderedDict()
for group, register_list in registers.iteritems():
registers = OrderedDict([(x.name(),
cpu_factory.create_register(self, x))
for x in register_list])
self._registers[group] = registers
@classmethod
@abc.abstractmethod
def architecture(cls):
raise NotImplementedError
def register(self, name):
for register_dict in self._registers.itervalues():
if name in register_dict:
return register_dict[name]
return None
def registers(self):
return self._registers.iteritems()
@abc.abstractmethod
def stack_pointer(self):
raise NotImplementedError
@abc.abstractmethod
def program_counter(self):
raise NotImplementedError
class CpuFactory(object):
__metaclass__ = abc.ABCMeta
def create_cpu(self, architecture):
assert architecture in _cpu_map
return _cpu_map.get(architecture,
None)(self)
@abc.abstractmethod
def create_register(self, cpu, register):
raise NotImplementedError
class CpuRepository(object):
def __init__(self, cpu_factory):
self._cpu_factory = cpu_factory
self._cpus = {}
def get_cpu(self, architecture):
if architecture in self._cpus:
return self._cpus[architecture]
cpu = self._cpu_factory.create_cpu(architecture)
self._cpus[architecture] = cpu
return cpu
def register_cpu(cls):
_cpu_map[cls.architecture()] = cls
return cls
_cpu_map = {}<|fim▁end|> | 10: '0x%020lX',
8: '0x%016lX', |
<|file_name|>cpu.py<|end_file_name|><|fim▁begin|># (void)walker hardware platform support
# Copyright (C) 2012-2013 David Holm <[email protected]>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import abc
from ..utils import OrderedDict
from ..utils import enum
Architecture = enum('Test', 'X86', 'X8664', 'Mips', 'Arm', 'Generic',
enum_type='Architecture')
class Register(object):
<|fim_middle|>
def create_static_register(register):
class StaticRegister(type(register), object):
def __init__(self, name):
super(StaticRegister, self).__init__(name)
self._size = register.size()
self._value = register.value()
def size(self):
return self._size
def value(self):
return self._value
return StaticRegister(register.name())
class Cpu(object):
__metaclass__ = abc.ABCMeta
def __init__(self, cpu_factory, registers):
self._registers = OrderedDict()
for group, register_list in registers.iteritems():
registers = OrderedDict([(x.name(),
cpu_factory.create_register(self, x))
for x in register_list])
self._registers[group] = registers
@classmethod
@abc.abstractmethod
def architecture(cls):
raise NotImplementedError
def register(self, name):
for register_dict in self._registers.itervalues():
if name in register_dict:
return register_dict[name]
return None
def registers(self):
return self._registers.iteritems()
@abc.abstractmethod
def stack_pointer(self):
raise NotImplementedError
@abc.abstractmethod
def program_counter(self):
raise NotImplementedError
class CpuFactory(object):
__metaclass__ = abc.ABCMeta
def create_cpu(self, architecture):
assert architecture in _cpu_map
return _cpu_map.get(architecture,
None)(self)
@abc.abstractmethod
def create_register(self, cpu, register):
raise NotImplementedError
class CpuRepository(object):
def __init__(self, cpu_factory):
self._cpu_factory = cpu_factory
self._cpus = {}
def get_cpu(self, architecture):
if architecture in self._cpus:
return self._cpus[architecture]
cpu = self._cpu_factory.create_cpu(architecture)
self._cpus[architecture] = cpu
return cpu
def register_cpu(cls):
_cpu_map[cls.architecture()] = cls
return cls
_cpu_map = {}
<|fim▁end|> | _register_fmt = {16: '0x%032lX',
10: '0x%020lX',
8: '0x%016lX',
4: '0x%08lX',
2: '0x%04lX',
1: '0x%02lX'}
def __init__(self, name):
self._name = name
def name(self):
return self._name
def size(self):
raise NotImplementedError
def value(self):
raise NotImplementedError
def str(self):
if self.value() is not None:
return self._register_fmt[self.size()] % self.value()
chars_per_byte = 2
return ''.join(['-' * (self.size() * chars_per_byte)]) |
<|file_name|>cpu.py<|end_file_name|><|fim▁begin|># (void)walker hardware platform support
# Copyright (C) 2012-2013 David Holm <[email protected]>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import abc
from ..utils import OrderedDict
from ..utils import enum
Architecture = enum('Test', 'X86', 'X8664', 'Mips', 'Arm', 'Generic',
enum_type='Architecture')
class Register(object):
_register_fmt = {16: '0x%032lX',
10: '0x%020lX',
8: '0x%016lX',
4: '0x%08lX',
2: '0x%04lX',
1: '0x%02lX'}
def __init__(self, name):
<|fim_middle|>
def name(self):
return self._name
def size(self):
raise NotImplementedError
def value(self):
raise NotImplementedError
def str(self):
if self.value() is not None:
return self._register_fmt[self.size()] % self.value()
chars_per_byte = 2
return ''.join(['-' * (self.size() * chars_per_byte)])
def create_static_register(register):
class StaticRegister(type(register), object):
def __init__(self, name):
super(StaticRegister, self).__init__(name)
self._size = register.size()
self._value = register.value()
def size(self):
return self._size
def value(self):
return self._value
return StaticRegister(register.name())
class Cpu(object):
__metaclass__ = abc.ABCMeta
def __init__(self, cpu_factory, registers):
self._registers = OrderedDict()
for group, register_list in registers.iteritems():
registers = OrderedDict([(x.name(),
cpu_factory.create_register(self, x))
for x in register_list])
self._registers[group] = registers
@classmethod
@abc.abstractmethod
def architecture(cls):
raise NotImplementedError
def register(self, name):
for register_dict in self._registers.itervalues():
if name in register_dict:
return register_dict[name]
return None
def registers(self):
return self._registers.iteritems()
@abc.abstractmethod
def stack_pointer(self):
raise NotImplementedError
@abc.abstractmethod
def program_counter(self):
raise NotImplementedError
class CpuFactory(object):
__metaclass__ = abc.ABCMeta
def create_cpu(self, architecture):
assert architecture in _cpu_map
return _cpu_map.get(architecture,
None)(self)
@abc.abstractmethod
def create_register(self, cpu, register):
raise NotImplementedError
class CpuRepository(object):
def __init__(self, cpu_factory):
self._cpu_factory = cpu_factory
self._cpus = {}
def get_cpu(self, architecture):
if architecture in self._cpus:
return self._cpus[architecture]
cpu = self._cpu_factory.create_cpu(architecture)
self._cpus[architecture] = cpu
return cpu
def register_cpu(cls):
_cpu_map[cls.architecture()] = cls
return cls
_cpu_map = {}
<|fim▁end|> | self._name = name |
Subsets and Splits