Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Lasevich committed Aug 20, 2019
1 parent d18ed6a commit ca0b1d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/quick_scheme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
''' QuickScheme Library Package '''

from quick_scheme.field import Field
from .field import Field, FieldValue
from .nodes import KeyBasedList
from .nodes import ListOfNodes, ListOfReferences
from .nodes import SchemeNode
15 changes: 12 additions & 3 deletions src/quick_scheme/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@


class FieldValue(object):
''' Field Value Holder '''
'''
Field Value Holder
This object holds a specific value for a specific node
'''

def __init__(self, field, node):
'''
Expand Down Expand Up @@ -93,6 +97,8 @@ def is_valid(self):

class Field(object):
''' Basic Field '''

# Python version independent version of a string
STR = STR

def __init__(self, name, **kwargs):
Expand Down Expand Up @@ -121,12 +127,15 @@ def __getattr__(self, item):

@property
def is_qs_node(self):
''' Return true, if ftype is a QuickScheme node(derivative of SchemeBaseNode)'''
'''
Returns true, if type for this field is a QuickScheme Node (i.e. a child of SchemeBaseNode)
'''
return issubclass(self.ftype, SchemeBaseNode)

@property
def has_default(self):
''' Has default value '''
'''
Returns True if this field has a default value '''
default = self._data.get('default', None)
return default is not None

Expand Down

0 comments on commit ca0b1d9

Please sign in to comment.