Skip to content

Commit b5190fa

Browse files
author
Luiko Czub
committed
separate file for version info
#1
1 parent 72f3392 commit b5190fa

File tree

5 files changed

+29
-12
lines changed

5 files changed

+29
-12
lines changed

setup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@
66
# Licensed under ???
77
#
88

9+
from os.path import join, dirname
910
from distutils.core import setup
1011

12+
execfile(join(dirname(__file__), 'src', 'testlink', 'version.py'))
13+
1114
setup(name='TestLink',
12-
version='0.0.1',
15+
version=VERSION,
1316
description='Python XMLRPC client for the TestLink API',
14-
author='Olivier Renault, kereval.com, Patrick Dassier',
15-
author_email='<[email protected]>, ???, ???',
16-
url='https://github.com/orenault/TestLink-API-Python-client',
17+
author='James Stock, Olivier Renault, TestLink-API-Python-client developers',
18+
author_email='???, ???, ???',
19+
url='https://github.com/lczub/TestLink-API-Python-client',
1720
license = 'unknown',
1821
package_dir = {'': 'src'},
1922
packages=['testlink'],

src/testlink/testlink.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class TestLink(TestLinkAPIClient):
1717
provide a user friendly library, with more robustness and error management
1818
"""
1919

20-
__VERSION__ = "0.1"
21-
2220
def __init__(self, server_url, key):
2321
"""
2422
Class initialisation
@@ -157,4 +155,5 @@ def getBuildByName(self, testProjectName, testPlanName, buildName):
157155
tl_helper = TestLinkHelper()
158156
tl_helper.setParamsFromArgs()
159157
myTestLink = tl_helper.connect(TestLink)
158+
print myTestLink
160159
print myTestLink.about()

src/testlink/testlinkapi.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88

99
import xmlrpclib
1010

11-
from testlinkhelper import TestLinkHelper
11+
from testlinkhelper import TestLinkHelper, VERSION
1212

13-
class TestLinkAPIClient(object):
13+
14+
class TestLinkAPIClient(object):
15+
16+
__slots__ = ['server', 'devKey', 'stepsList']
1417

18+
__VERSION__ = VERSION
1519

1620
def __init__(self, server_url, devKey):
1721
self.server = xmlrpclib.Server(server_url)
@@ -537,19 +541,19 @@ def getProjectIDByName(self, projectName):
537541

538542
def __str__(self):
539543
message = """
540-
TestLinkAPIClient - version %s
544+
TestLinkAPIClient - class %s - version %s
541545
@author: Olivier Renault ([email protected])
542546
@author: kereval.com
543547
@author: Patrick Dassier
544-
545548
"""
546-
return message % self.__VERSION__
549+
return message % (self.__class__.__name__, self.__VERSION__)
547550

548551

549552
if __name__ == "__main__":
550553
tl_helper = TestLinkHelper()
551554
tl_helper.setParamsFromArgs()
552555
myTestLink = tl_helper.connect(TestLinkAPIClient)
556+
print myTestLink
553557
print myTestLink.about()
554558

555559

src/testlink/testlinkhelper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import os
1010
from argparse import ArgumentParser
11+
from version import VERSION
1112

1213

1314
class TestLinkHelper(object):
@@ -43,7 +44,8 @@ class TestLinkHelper(object):
4344
ENVNAME_DEVKEY = 'TESTLINK_API_PYTHON_DEVKEY'
4445
DEFAULT_SERVER_URL = 'http://localhost/testlink/lib/api/xmlrpc.php'
4546
DEFAULT_DEVKEY = '42'
46-
DEFAULT_DESCRIPTION = 'Python XMLRPC client for the TestLink API'
47+
DEFAULT_DESCRIPTION = 'Python XMLRPC client for the TestLink API v%s' \
48+
% VERSION
4749

4850
def __init__(self, server_url=None, devkey=None):
4951
""" fill slots _server_url and _devkey

src/testlink/version.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#! /usr/bin/python
2+
# -*- coding: UTF-8 -*-
3+
4+
# Copyright 2012 TestLink-API-Python-client developers
5+
#
6+
# Licensed under ???
7+
# see https://github.com/orenault/TestLink-API-Python-client/issues/4
8+
9+
VERSION = '0.4.0-preAlpha'

0 commit comments

Comments
 (0)