plugins now use ujson

This commit is contained in:
Kevin Froman 2020-04-03 04:27:37 -05:00
parent a8ab5d20f1
commit 919ab12b76
7 changed files with 54 additions and 41 deletions

View File

@ -1,9 +1,14 @@
''' """Onionr - Private P2P Communication.
Onionr - Private P2P Communication
HTTP endpoints for controlling IMs HTTP endpoints for controlling IMs
''' """
''' import ujson as json
from flask import Response, request, redirect, Blueprint, send_from_directory
import deadsimplekv as simplekv
import filepaths
"""
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
@ -16,11 +21,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
''' """
import json
from flask import Response, request, redirect, Blueprint, send_from_directory
import deadsimplekv as simplekv
import filepaths
flask_blueprint = Blueprint('chat_control', __name__) flask_blueprint = Blueprint('chat_control', __name__)
key_store = simplekv.DeadSimpleKV(filepaths.cached_storage, refresh_seconds=5) key_store = simplekv.DeadSimpleKV(filepaths.cached_storage, refresh_seconds=5)
@flask_blueprint.route('/chatapi/ping') @flask_blueprint.route('/chatapi/ping')

View File

@ -19,7 +19,7 @@
''' '''
# Imports some useful libraries # Imports some useful libraries
import locale, sys, os, threading, json import locale, sys, os, threading, ujson as json
locale.setlocale(locale.LC_ALL, '') locale.setlocale(locale.LC_ALL, '')
import onionrservices, logger, config import onionrservices, logger, config
from onionrservices import bootstrapservice from onionrservices import bootstrapservice

View File

@ -1,9 +1,18 @@
''' """Onionr - Private P2P Communication.
Onionr - Private P2P Communication
HTTP endpoints for communicating with peers HTTP endpoints for communicating with peers
''' """
''' import sys
import os
import deadsimplekv as simplekv
import ujson as json
from flask import Response, request, redirect, Blueprint, abort, g
from utils import identifyhome
from onionrutils import localcommand
import filepaths
"""
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
@ -16,12 +25,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
''' """
import sys, os, json
from utils import identifyhome
from onionrutils import localcommand
import deadsimplekv as simplekv, filepaths
from flask import Response, request, redirect, Blueprint, abort, g
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
direct_blueprint = Blueprint('chat', __name__) direct_blueprint = Blueprint('chat', __name__)

View File

@ -3,9 +3,10 @@
This file primarily serves to allow specific fetching of circles board messages This file primarily serves to allow specific fetching of circles board messages
""" """
import operator import operator
import json
import os import os
import ujson as json
from flask import Response, Blueprint from flask import Response, Blueprint
from deadsimplekv import DeadSimpleKV from deadsimplekv import DeadSimpleKV

View File

@ -19,7 +19,10 @@
''' '''
# Imports some useful libraries # Imports some useful libraries
import logger, config, threading, time, datetime, sys, json import logger, config, threading, time, datetime, sys
import ujson as json
from onionrutils import stringvalidators, bytesconverter from onionrutils import stringvalidators, bytesconverter
from onionrcrypto import encryption, keypair, signing, getourkeypair from onionrcrypto import encryption, keypair, signing, getourkeypair
import onionrexceptions, onionrusers import onionrexceptions, onionrusers

View File

@ -1,9 +1,22 @@
''' """Onionr - Private P2P Communication.
Onionr - Private P2P Communication
HTTP endpoints for mail plugin. HTTP endpoints for mail plugin
''' """
''' import sys
import os
import ujson as json
from flask import Response, request, redirect, Blueprint, abort
import deadsimplekv as simplekv
from onionrusers import contactmanager
from onionrutils import stringvalidators
from utils import reconstructhash, identifyhome
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import loadinbox
import sentboxdb
"""
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
@ -16,17 +29,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
''' """
import sys, os, json
from flask import Response, request, redirect, Blueprint, abort
from onionrusers import contactmanager
from onionrutils import stringvalidators
from utils import reconstructhash, identifyhome
import filepaths
import deadsimplekv as simplekv
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import loadinbox, sentboxdb
flask_blueprint = Blueprint('mail', __name__) flask_blueprint = Blueprint('mail', __name__)
kv = simplekv.DeadSimpleKV(identifyhome.identify_home() + '/mailcache.dat') kv = simplekv.DeadSimpleKV(identifyhome.identify_home() + '/mailcache.dat')

View File

@ -5,7 +5,8 @@ Private messages in an email like fashion
import locale import locale
import sys import sys
import os import os
import json
import ujson as json
from onionrusers import contactmanager from onionrusers import contactmanager
from utils import reconstructhash from utils import reconstructhash