Exemple #1
0
def urls(environ):
    template = os.path.join(environ['DOCUMENT_ROOT'], 'test/template')
    if environ['PATH_INFO'] == '/test/work':
        return test.work()
    elif environ['PATH_INFO'] == '/test/html':
        return test.html(environ, template)
    elif environ['PATH_INFO'] == '/test2':
        return test2.test2()
    else:
        return test.test()
Exemple #2
0
# coding=utf-8
import test2


def test1():
    print("---test1---")


test1()
test2.test2()
Exemple #3
0
def test1():
    return test2()
Exemple #4
0
def test2():
    a = test2()
    return str(a)
Exemple #5
0
from test2 import test2

name3 = input("sdc")
family3 = input("adc")

obj2 = test2(name3, family3)
Exemple #6
0
# coding=utf-8

from test2 import test2
from test1 import Test

# def test2():
#     print(Test.__test__)
a = Test.__test__
print(a)

print(a.split('\n'))
print(id(Test))

test2()
Exemple #7
0
from test2 import test2

d = {"repo": [{"name": "resque"}, {"name": "hub"}, {"name": "rip"}]}
print test2(d)
Exemple #8
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Test the singleton module:
    . add some attributes
    . call function in another module that sets a singleton attribute
    . dump all singleton attributes
    . save state into a file for test3.py
"""

import singleton
import test2

singleton.tom = 'tom'
singleton.dick = 2
singleton.harry = (3.0, 'harry')

test2.test2({1: 'one'})
print('singleton.test2=%s' % str(singleton.test2))

print('singleton: %s' % str(dir(singleton)))

payload = singleton._payload()
for (k, v) in payload.items():
    print('singleton.%s=%s\t%s' % (k, str(v), type(v)))

singleton._save()
Exemple #9
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Test the singleton module:
    . add some attributes
    . call function in another module that sets a singleton attribute
    . dump all singleton attributes
    . save state into a file for test3.py
"""

import singleton
import test2

singleton.tom = 'tom'
singleton.dick = 2
singleton.harry = (3.0, 'harry')

test2.test2({1:'one'})
print('singleton.test2=%s' % str(singleton.test2))

print('singleton: %s' % str(dir(singleton)))

payload = singleton._payload()
for (k, v) in payload.items():
    print('singleton.%s=%s\t%s' % (k, str(v), type(v)))

singleton._save()