Merge branch 'master' into dev
This commit is contained in:
commit
4a1cf1d007
4 changed files with 14 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
[metadata]
|
||||
name = httpaste-victorykit
|
||||
version = 1.0.4-alpha
|
||||
version = 1.0.5-alpha
|
||||
author = Tiara Rodney
|
||||
author_email = t.rodney@victoryk.it
|
||||
description = a versatile HTTP pastebin
|
||||
|
|
@ -39,4 +39,5 @@ console_scripts =
|
|||
where = src
|
||||
|
||||
[options.package_data]
|
||||
schema = src/httpaste/schema/httpaste.openapi.json
|
||||
openapi_schema = src/httpaste/schema/httpaste.openapi.json
|
||||
sql_schema = *.sql
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
"""
|
||||
import argparse
|
||||
import os
|
||||
from importlib.resources import open_text
|
||||
|
||||
|
||||
def _this_dir(basename: str) -> str:
|
||||
|
|
@ -20,7 +21,7 @@ def _path_output(path, echo: bool = False) -> str:
|
|||
return path
|
||||
else:
|
||||
|
||||
with open(path, 'r') as fh:
|
||||
with open_text('httpaste', path) as fh:
|
||||
|
||||
return fh.read()
|
||||
|
||||
|
|
@ -51,21 +52,21 @@ def command_wsgi(**kwargs):
|
|||
"""get WSGI script
|
||||
"""
|
||||
|
||||
print(_path_output(_this_dir('wsgi.py'), kwargs.get('echo')))
|
||||
print(_path_output('wsgi.py', kwargs.get('echo')))
|
||||
|
||||
|
||||
def command_cgi(**kwargs):
|
||||
"""get CGI script
|
||||
"""
|
||||
|
||||
print(_path_output(_this_dir('cgi.py'), kwargs.get('echo')))
|
||||
print(_path_output('cgi.py', kwargs.get('echo')))
|
||||
|
||||
|
||||
def command_fcgi(**kwargs):
|
||||
"""get FastCGI script
|
||||
"""
|
||||
|
||||
print(_path_output(_this_dir('fcgi.py'), kwargs.get('echo')))
|
||||
print(_path_output('fcgi.py', kwargs.get('echo')))
|
||||
|
||||
|
||||
def command_default_config(**kwargs):
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
from os import path
|
||||
from sqlite3 import Connection
|
||||
from time import time
|
||||
from importlib.resources import open_text
|
||||
|
||||
|
||||
def load(proto: object, connection: Connection, model_class: type):
|
||||
|
|
@ -71,7 +72,7 @@ def init(connection: Connection):
|
|||
|
||||
cursor = connection.cursor()
|
||||
|
||||
with open(path.join(path.dirname(__file__), 'paste.sql'), 'r') as fh:
|
||||
with open_text('httpaste.backend.sqlite', 'paste.sql') as fh:
|
||||
|
||||
statement = fh.read()
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
"""
|
||||
from os import path
|
||||
from sqlite3 import Connection
|
||||
from httpaste.model import User
|
||||
from importlib.resources import open_text
|
||||
|
||||
|
||||
def load(proto: object, connection: Connection, model_class: type):
|
||||
|
|
@ -57,7 +59,7 @@ def init(connection: Connection) -> None:
|
|||
|
||||
cursor = connection.cursor()
|
||||
|
||||
with open(path.join(path.dirname(__file__), 'user.sql'), 'r') as fh:
|
||||
with open_text('httpaste.backend.sqlite', 'user.sql') as fh:
|
||||
|
||||
statement = fh.read()
|
||||
|
||||
|
|
@ -70,4 +72,4 @@ def init(connection: Connection) -> None:
|
|||
|
||||
def sanitize(connection: Connection, model_class) -> int:
|
||||
|
||||
return 0
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue