File tree 5 files changed +10
-37
lines changed
5 files changed +10
-37
lines changed Original file line number Diff line number Diff line change
1
+ include requirements.txt
2
+ include LICENSE
3
+ include README.md
4
+
5
+ global-exclude *.pyc
6
+ global-exclude __pycache__
Original file line number Diff line number Diff line change @@ -192,36 +192,3 @@ def poll_async(self):
192
192
def poll_forever (self ):
193
193
while True :
194
194
self .poll ()
195
-
196
- def poll_forever_websocket (self ):
197
- """
198
- An alternative implementation of the watch behavior using websockets. Doesn't seem to be particularly faster.
199
- Note: requires installation of the "asyncio" and "websockets" packages.
200
- """
201
-
202
- import asyncio
203
- import websockets
204
-
205
- async def hello ():
206
-
207
- while True :
208
- try :
209
-
210
- self .initialize ()
211
-
212
- headers = [("Cookie" , "AWSALB={};" .format (self .client .session .cookies .get ("AWSALB" )))]
213
-
214
- url = "wss://msgstore.www.notion.so/primus/?sessionId={}&EIO=3&transport=websocket&sid={}" .format (self .session_id , self .sid )
215
-
216
- async with websockets .connect (url , extra_headers = headers ) as websocket :
217
- await websocket .send ("2probe" )
218
- await websocket .recv ()
219
- await websocket .send ("5" )
220
- while True :
221
- event = json .loads (re .match ("\d+(.*)" , await websocket .recv ()).groups ()[0 ])
222
- self ._refresh_updated_records ([event ])
223
-
224
- except websockets .ConnectionClosed :
225
- pass
226
-
227
- asyncio .get_event_loop ().run_until_complete (hello ())
Original file line number Diff line number Diff line change 5
5
API_BASE_URL = BASE_URL + "api/v3/"
6
6
SIGNED_URL_PREFIX = "https://www.notion.so/signed/"
7
7
S3_URL_PREFIX = "https://s3-us-west-2.amazonaws.com/secure.notion-static.com/"
8
- DATA_DIR = str (Path . home ( ).joinpath (".notion-py" ))
8
+ DATA_DIR = str (Path ( os . path . expanduser ( "~" ) ).joinpath (".notion-py" ))
9
9
CACHE_DIR = str (Path (DATA_DIR ).joinpath ("cache" ))
10
10
LOG_FILE = str (Path (DATA_DIR ).joinpath ("notion.log" ))
11
11
Original file line number Diff line number Diff line change @@ -3,6 +3,4 @@ commonmark
3
3
bs4
4
4
tzlocal
5
5
python-slugify
6
- # asyncio
7
- # websockets
8
6
dictdiffer
Original file line number Diff line number Diff line change 13
13
14
14
setuptools .setup (
15
15
name = "notion" ,
16
- version = "0.0.9 " ,
16
+ version = "0.0.15 " ,
17
17
author = "Jamie Alexandre" ,
18
18
author_email = "jamalex+python@gmail.com" ,
19
19
description = "Unofficial Python API client for Notion.so" ,
20
20
long_description = long_description ,
21
21
long_description_content_type = "text/markdown" ,
22
22
url = "https://github.com/jamalex/notion-py" ,
23
23
install_requires = install_requires ,
24
+ include_package_data = True ,
24
25
packages = setuptools .find_packages (),
26
+ python_requires = '>=3.4' ,
25
27
classifiers = [
26
28
"Programming Language :: Python :: 3" ,
27
29
"License :: OSI Approved :: MIT License" ,
You can’t perform that action at this time.
0 commit comments