Skip to content

Commit

Permalink
Merge pull request #29 from Capitains/issue-28
Browse files Browse the repository at this point in the history
Proposal fix for issue #28
  • Loading branch information
PonteIneptique committed Sep 2, 2015
2 parents 0629e7a + 208e2e8 commit 0415326
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Compiled python modules.
*.pyc
.idea

# Setuptools distribution folder.
/dist/
Expand Down
2 changes: 1 addition & 1 deletion MyCapytain/common/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __getitem__(self, key):
>>> a = Reference(reference="1.1@Achiles[1]-1.2@Zeus[1]")
>>> print(a[1]) # "1.1@Achiles[1]"
>>> print(a["start_list"]) # ("1", "1")
>>> print(a[6"]) # ("Zeus", "1")
>>> print(a[6]) # ("Zeus", "1")
>>> print(a[7]) # "1.1@Achiles[1]-1.2@Zeus[1]"
"""
if key == 1 or key == "start":
Expand Down
14 changes: 7 additions & 7 deletions MyCapytain/endpoints/cts5.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def call(self, parameters):
request = requests.get(self.endpoint, params=parameters)
return request.text

def getCapabilities(self, inventory):
def getCapabilities(self, inventory=None):
""" Retrieve the inventory information of an API
:param inventory: Name of the inventory
Expand All @@ -45,7 +45,7 @@ def getCapabilities(self, inventory):
"request": "GetCapabilities"
})

def getValidReff(self, urn, inventory, level=None):
def getValidReff(self, urn, inventory=None, level=None):
""" Retrieve valid urn-references for a text
:param urn: URN identifying the text
Expand All @@ -63,7 +63,7 @@ def getValidReff(self, urn, inventory, level=None):
"request": "GetValidReff"
})

def getFirstUrn(self, urn, inventory):
def getFirstUrn(self, urn, inventory=None):
""" Retrieve the first passage urn of a text
:param urn: URN identifying the text
Expand All @@ -78,7 +78,7 @@ def getFirstUrn(self, urn, inventory):
"request": "GetFirstUrn"
})

def getPrevNextUrn(self, urn, inventory):
def getPrevNextUrn(self, urn, inventory=None):
""" Retrieve the previous and next passage urn of one passage
:param urn: URN identifying the text's passage (Minimum depth : 1)
Expand All @@ -93,7 +93,7 @@ def getPrevNextUrn(self, urn, inventory):
"request": "GetPrevNextUrn"
})

def getLabel(self, urn, inventory):
def getLabel(self, urn, inventory=None):
""" Retrieve informations about a CTS Urn
:param urn: URN identifying the text's passage (Minimum depth : 1)
Expand All @@ -108,7 +108,7 @@ def getLabel(self, urn, inventory):
"request": "GetLabel"
})

def getPassage(self, urn, inventory, context=None):
def getPassage(self, urn, inventory=None, context=None):
""" Retrieve a passage
:param urn: URN identifying the text's passage (Minimum depth : 1)
Expand All @@ -126,7 +126,7 @@ def getPassage(self, urn, inventory, context=None):
"request": "GetPassage"
})

def getPassagePlus(self, urn, inventory, context=None):
def getPassagePlus(self, urn, inventory=None, context=None):
""" Retrieve a passage and informations about it
:param urn: URN identifying the text's passage (Minimum depth : 1)
Expand Down
2 changes: 1 addition & 1 deletion MyCapytain/resources/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __str__(self):

child = ""
if isinstance(self.child, Citation):
child=str(self.child)
child = str(self.child)

label = ""
if self.name is not None:
Expand Down
2 changes: 1 addition & 1 deletion MyCapytain/resources/proto/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def getLabel(self):

@property
def reffs(self):
""" Get the lowest cRefPattern in the hierarchy
""" Get all valid reffs for every part of the Text
:rtype: MyCapytain.resources.texts.tei.Citation
"""
Expand Down
1 change: 1 addition & 0 deletions tests/resources/texts/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import MyCapytain.resources.texts.local
import MyCapytain.resources.texts.tei
import MyCapytain.common.reference


class TestLocalXMLTextImplementation(unittest.TestCase, xmlunittest.XmlTestMixin):

Expand Down

0 comments on commit 0415326

Please sign in to comment.