-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
69 lines (51 loc) · 1.64 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#*********************************************************************************************#
#*********************************************************************************************#
#******************witten by Neil Hao([email protected]), 2013/05/19*************************#
#*********************************************************************************************#
#*********************************************************************************************#
#*********************************************************************************************#
import pickle
from StringIO import StringIO
from logparser import *
import inspect
from base import *
class TestObj:
sname = 'class TestObj'
print 'test ***********', sname
def __init__( self ):
self.func = TestObj.printout
self.name = 'public TestObj'
self.__name = 'TestObj'
print 'test object'
self.printout( 'fasdfa' )
def printout( self, string ):
print 'printout function', string
print '======================'
print func_name()
print '**********************'
def test( self ):
self.newName = 'new name'
self.func( self, 'ok' )
def s_test():
print 'static func'
def set_value( self, mname, value ):
self.__dict__[mname] = value
def get_value( self, mname ):
return self.__dict__[mname]
class Derived( TestObj ):
pass
class StatusMap():
testMap = None
def __init__( self ):
self.value = 'afdsfdsafsd'
StatusMap.testMap = {
'test':1213,
'fdsfds':5454
}
print '=======================test pickle================'
status = StatusMap()
status.val2 = 13213131
parser =
buf = StringIO()
pickle.dump( status, buf, 0 )
print buf.getvalue()