|
Revision 2037, 0.6 kB
(checked in by arj..@yirdis.nl, 1 year ago)
|
cleanup of utils directory
|
- Property svn:eol-style set to
native
- Property svn:executable set to
*
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
import sys |
|---|
| 11 |
|
|---|
| 12 |
sys.path.append("..") |
|---|
| 13 |
|
|---|
| 14 |
from gaphor.UML import * |
|---|
| 15 |
|
|---|
| 16 |
done = [ object ] |
|---|
| 17 |
def print_vars(cls): |
|---|
| 18 |
global done |
|---|
| 19 |
done.append(cls) |
|---|
| 20 |
print cls.__name__ + ":" |
|---|
| 21 |
dict = cls.__dict__ |
|---|
| 22 |
for key in dict.keys(): |
|---|
| 23 |
print "\t" + key + ":", str(dict[key]) |
|---|
| 24 |
for base in cls.__bases__: |
|---|
| 25 |
if base not in done: |
|---|
| 26 |
print_vars(base) |
|---|
| 27 |
|
|---|
| 28 |
args = sys.argv[1:] |
|---|
| 29 |
|
|---|
| 30 |
if args: |
|---|
| 31 |
cls = eval(args[0]) |
|---|
| 32 |
print_vars(cls) |
|---|
| 33 |
else: |
|---|
| 34 |
print "Usage: " + sys.argv[0] + " <UML class name>" |
|---|
| 35 |
sys.exit(1) |
|---|