Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
setminami committed Feb 7, 2018
1 parent a6c9d90 commit d0bc471
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions jsonica/jsonica.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def __init__(self):

def regist_subcommand(self, command):
"""
sub_commandsの型に依存させないためのIF
型変更の必要がでたら、局所的に操作を書き換える
| sub_commandsの型に依存させないためのIF
| 型変更の必要がでたら、局所的に操作を書き換える
"""
from sub_command_core.sub_command import SubCommands
Hoare.P(issubclass(command.__class__, SubCommands))
Expand Down
11 changes: 7 additions & 4 deletions jsonica/schema_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ class Validator(str, enum.Enum):
jsonschema = 'jsonschema'

class TypeSign(str, enum.Enum):
""" Type adhoc """
"""
| Type adhoc
| schemaからダイナミックに取得するのが理想
"""
# https://tools.ietf.org/html/draft-zyp-json-schema-04
# RFC 4627#2.1 https://tools.ietf.org/html/rfc4627
OBJ = 'object'
Expand All @@ -23,7 +26,7 @@ class TypeSign(str, enum.Enum):

class Schema:
"""
抽象的な中継クラス
| 抽象的な中継クラス
下流具象クラスへの中継とreduce以外の作業はさせないこと
"""
schema_url = '' # subclassで設定 mandatoryのため空宣言
Expand Down Expand Up @@ -79,8 +82,8 @@ def make_schema(self, desc):

def validate(self, evl, desc):
"""
_validateに流す
成功すればスルー、失敗したらその場でcommand error / 判定値は返さない
| _validateに流す
| 成功すればスルー、失敗したらその場でcommand error / 判定値は返さない
NOTE: 具体的なerrorハンドリングは_validate内で処理すること
"""
Hoare.P(isinstance(evl, list) or isinstance(evl, dict))
Expand Down
1 change: 1 addition & 0 deletions jsonica/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def sprint(cls, msg, flag=False):
class, f単位で出力制御設定するためのシンプルなDEBUG出力関数
:param msg: 表示文字列
:param flag: 表示制御flag
NOTE: Util\.sprint\(.+,\s*True\s*\) が見つかったらprintに書き換える
"""
# if flag:
Expand Down

0 comments on commit d0bc471

Please sign in to comment.