mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 11:26:29 +03:00
remove unusued sync methods
This commit is contained in:
@@ -12,7 +12,7 @@ def main():
|
|||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
author='holger krekel, Floris Bruynooghe, Bjoern Petersen and contributors',
|
author='holger krekel, Floris Bruynooghe, Bjoern Petersen and contributors',
|
||||||
setup_requires=['cffi>=1.0.0'],
|
setup_requires=['cffi>=1.0.0'],
|
||||||
install_requires=['cffi>=1.0.0', 'requests', 'attrs', 'six'],
|
install_requires=['cffi>=1.0.0', 'attrs', 'six'],
|
||||||
packages=setuptools.find_packages('src'),
|
packages=setuptools.find_packages('src'),
|
||||||
package_dir={'': 'src'},
|
package_dir={'': 'src'},
|
||||||
cffi_modules=['src/deltachat/_build.py:ffibuilder'],
|
cffi_modules=['src/deltachat/_build.py:ffibuilder'],
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import threading
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
import requests
|
|
||||||
from array import array
|
from array import array
|
||||||
try:
|
try:
|
||||||
from queue import Queue
|
from queue import Queue
|
||||||
@@ -387,22 +386,6 @@ class IOThreads:
|
|||||||
class EventHandler(object):
|
class EventHandler(object):
|
||||||
_dc_context = attr.ib(validator=v.instance_of(ffi.CData))
|
_dc_context = attr.ib(validator=v.instance_of(ffi.CData))
|
||||||
|
|
||||||
def read_url(self, url):
|
|
||||||
try:
|
|
||||||
r = requests.get(url)
|
|
||||||
except requests.ConnectionError:
|
|
||||||
return ''
|
|
||||||
else:
|
|
||||||
return r.content
|
|
||||||
|
|
||||||
def dc_event_http_get(self, data1, data2):
|
|
||||||
url = data1
|
|
||||||
content = self.read_url(url)
|
|
||||||
if not isinstance(content, bytes):
|
|
||||||
content = content.encode("utf8")
|
|
||||||
# we need to return a fresh pointer that the core owns
|
|
||||||
return lib.dupstring_helper(content)
|
|
||||||
|
|
||||||
def dc_event_is_offline(self, data1, data2):
|
def dc_event_is_offline(self, data1, data2):
|
||||||
return 0 # always online
|
return 0 # always online
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user