Skip to content

Commit

Permalink
Fixed another Bug with OrientDB name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostico committed Jun 6, 2016
1 parent 1c630d0 commit 3388925
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
10 changes: 4 additions & 6 deletions pyorient/otypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,16 @@ def _parse_version( self, string_release ):
if "-" in self.minor:
_temp = self.minor.split( "-" )
self.minor = _temp[0]
self.build = 0
self.build = '0'
self.subversion = _temp[1]

if "-" in self.build:
_temp = self.build.split("-")
self.build = _temp[0]
self.subversion = _temp[1]
else:
import re
preg = re.match( '([0-9]+)(.*)', self.build )
preg = re.match( '([0-9])[\.\- ]*(.*)', self.build )
self.build = preg.group(1)
self.subversion = preg.group(2)
else:
self.build = self.build[0]

self.major = int( self.major )
self.minor = int( self.minor )
Expand Down
38 changes: 33 additions & 5 deletions test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
import pyorient
db_name = "GratefulDeadConcerts"
client = pyorient.OrientDB("localhost", 2424)
client.set_session_token(True)
cluster_info = client.db_open( db_name, "admin", "admin" )
print(client.db_count_records())
# db_name = "GratefulDeadConcerts"
# client = pyorient.OrientDB("localhost", 2424)
# client.set_session_token(True)
# cluster_info = client.db_open( db_name, "admin", "admin" )
# print(client.db_count_records())

release = "2.2.0 (build develop@r79d281140b01c0bc3b566a46a64f1573cb359783; 2016-05-18 14:14:32+0000)"
x = pyorient.OrientVersion(release)
print(x.major)
print(x.minor)
print(x.build)
print(x.subversion)

release = "2.2.0-rc1"
x = pyorient.OrientVersion(release)
print(x.major)
print(x.minor)
print(x.build)
print(x.subversion)

release = "2.2.0-rc1"
x = pyorient.OrientVersion(release)
print(x.major)
print(x.minor)
print(x.build)
print(x.subversion)

release = "2.2.0 ;Unknown (build 0)"
x = pyorient.OrientVersion(release)
print(x.major)
print(x.minor)
print(x.build)
print(x.subversion)

0 comments on commit 3388925

Please sign in to comment.