Skip to content

Instantly share code, notes, and snippets.

View lau-jay's full-sized avatar
🐍
typing

Jay Lau lau-jay

🐍
typing
View GitHub Profile
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#define BUF_SIZE 1024
void error_handling(char *message);
int main(int argc, char *argv[])
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <fcntl.h>
#define BUF_SIZE 1024
def get_logger(self):
>> 18 filename = "/access.log" if self.log_name == "access_log" else "/server.log"
17 fmt = (
>> 16 "%(color)s[%(levelname)1.1s %(asctime)s {listen_port}:%(module)s:%(lineno)d:%(funcName)s] %(end_color)s"
15 "%(message)s".format(listen_port=ServerBaseConfig["listen_port"])
14 )
13 import os
12
11 if not os.path.isdir(ServerBaseConfig["log_dir"]):
10 os.mkdir(ServerBaseConfig["log_dir"])
class NotifierOP(Notifier):
def __init__(self):
pass
def send_message(self, message):
self.post_process(message)
def post_process(self, message):
"""
Process error.
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
redis = "*"
logzero = "*"
from datetime import datetime, timedelta
from tornado import httpclient, gen, queues
from tornado import escape
import os
# test
from tornado.ioloop import IOLoop
from apscheduler.schedulers.tornado import TornadoScheduler