Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaning API checking code

  • Loading branch information...
commit 8e734cd79d23c8b36d429178d857bbfcecd3a034 1 parent abb2d0f
@izidormatusov izidormatusov authored
Showing with 10 additions and 9 deletions.
  1. +10 −9 liblarch/__init__.py
View
19 liblarch/__init__.py
@@ -24,18 +24,19 @@
from liblarch.filteredtree import FilteredTree
from liblarch.filters_bank import FiltersBank
-#API version of liblarch.
-#Your application is compatible if the major version number match liblarch's one
-#and if your minor version number is inferior to liblarch's one.
+# API version of liblarch.
+# Your application is compatible if the major version number match liblarch's
+# one and if your minor version number is inferior to liblarch's one.
#
-#The minor number is incremented when a method is added to the API
-#The major number is incremented if an existing method is removed or modified
-api="1.1"
+# The major number is incremented if an existing method is removed or modified
+# The minor number is incremented when a method is added to the API
+API = "1.1"
+
def is_compatible(request):
- major,minor=request.split(".")
- current_ma,current_mi=api.split(".")
- return (major == current_ma and minor <= current_mi)
+ major, minor = [int(i) for i in request.split(".")]
+ current_ma, current_mi = [int(i) for i in API.split(".")]
+ return major == current_ma and minor <= current_mi
class TreeNode(_Node):
""" The public interface for TreeNode

0 comments on commit 8e734cd

Please sign in to comment.
Something went wrong with that request. Please try again.