Ejemplo n.º 1
0
from server import startup
import httpServer
import constants
import threading
import queue
import os
import ascii
const = constants.vars()

tcpServerThread = threading.Thread(target=startup, args=(), daemon=True)
tcpServerThread.start()
httpServerThread = threading.Thread(target=httpServer.startup,
                                    args=(),
                                    daemon=True)
httpServerThread.start()

tcpServerThread.join()
httpServerThread.join()
Ejemplo n.º 2
0
import sqlite3
from pathlib import Path, PurePath, PosixPath
import sys
import string
import random
import datetime
import traceback
import xml.etree.ElementTree as ET
SCRIPT_DIR = os.path.dirname(
    os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR)))
from constants import vars
from SQLcommands import sql

sql = sql()
const = vars()
dir = dir_path = os.path.dirname(os.path.realpath(__file__))
print(dir)
path = PurePath(dir, 'DataPackages')
print(path)
if Path(path).exists() == True:
    pass
elif Path(path).exists() == False:
    os.mkdir(path)

sqliteServer = sqlite3.connect(const.DATABASE)
cursor = sqliteServer.cursor()
cursor.execute(sql.CREATEDPTABLE)
cursor.execute(sql.CREATEVIDEOTABLE)
cursor.close()
sqliteServer.commit()