File: TestVersion.py

package info (click to toggle)
python-pmw 0.6.2-0.1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,652 kB
  • ctags: 2,716
  • sloc: python: 10,720; makefile: 44; sh: 24
file content (19 lines) | stat: -rw-r--r-- 412 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Set the version of Pmw to use for the tests based on the directory
# name.

import imp
import os
import regsub
import Pmw

file = imp.find_module(__name__)[1]
if not os.path.isabs(file):
    file = os.path.join(os.getcwd(), file)
file = os.path.normpath(file)

dir = os.path.dirname(file)
dir = os.path.dirname(dir)
dir = os.path.basename(dir)

version = regsub.gsub('_', '.', dir[4:])
Pmw.setversion(version)