Exemple #1
0
#!/usr/bin/env python
# coding:utf-8
'''
Created on: 

@author: 张晓宇

Email: [email protected]

Version: 1.0

Description:

Help:
'''
from core import core
if __name__ == '__main__':
    core.run()
Exemple #2
0
        i += 1
    return path


if __name__ == '__main__':
    core.__init__()  # инициализация модуля
    str_time = time.strftime('%b %Y %H:%M:%S', time.localtime())
    profile = cProfile.Profile()
    if core.config['MAIN']['cgitb'] == 'yes':  # включить вывод ошибок
        if core.config['MAIN']['tolog'] == 'yes':  # вывод в лог
            cgitb.enable(0, get_file(os.path.join(core.PATH_CGITB, str_time
                                                  + 'log')))
        else:
            cgitb.enable()
    if core.config['MAIN']['profile'] == 'yes':  # включить профилирование
        profile.enable()
    header, content, cookies = core.run(cgi.FieldStorage())  # получение данных
    # вывод заголовка
    for line in header:
        print(line)
    print(get_all(cookies))  # вывод куков (относятся к заголовку)
    print('\n')
    print(content)  # вывод содержимого
    if core.config['MAIN']['print_time'] == 'yes':  # вывод времени генерации
        print('<!-- Page generated for: ' + str(time.time() - time_start)
              + 's -->')
    if core.config['MAIN']['profile'] == 'yes':  # сохранение профиля
        profile.disable()
        profile.dump_stats(get_file(os.path.join(core.PATH_PROFILE, str_time
                                                 + 'log')))
#!/usr/bin/env python3
# coding:utf-8
"""
Created on: 

@author: 张晓宇

Email: [email protected]

Version: 

Description: 
Help:
"""
from core import core
import sys

if __name__ == "__main__":
    if len(sys.argv) == 2:
        core.run(sys.argv[0:])
    else:
        print("Usage: %s filename" % sys.argv[0])
Exemple #4
0
#!/usr/bin/env python3
# coding:utf-8
'''
Created on: 

@author: 张晓宇

Email: [email protected]

Version: 

Description: 
Help:
'''
from core import core
import sys
if __name__ == "__main__":
    if len(sys.argv) == 2:
        core.run(sys.argv[0:])
    else:
        print('Usage: %s filename' % sys.argv[0])
Exemple #5
0
def main():
    core.run()