File: TestVersion.py

package info (click to toggle)
python-pmw 1.2-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,024 kB
  • ctags: 3,802
  • sloc: python: 17,143; makefile: 41
file content (19 lines) | stat: -rw-r--r-- 415 bytes parent folder | download | duplicates (8)
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 string
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 = string.replace(dir[4:], '_', '.')
Pmw.setversion(version)