Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
shadowban-eu-backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
shadowban-eu-backend
Commits
53d7ee30
Commit
53d7ee30
authored
Dec 24, 2020
by
Raphael Beer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: using types for hints direclty is not available python<3.9
parent
26f6f11f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
tests/profile.py
tests/profile.py
+7
-4
twitter_session.py
twitter_session.py
+1
-4
util.py
util.py
+3
-0
No files found.
tests/profile.py
View file @
53d7ee30
from
typing
import
Any
import
sys
import
pathlib
from
typing
import
Any
,
Tuple
,
Dict
sys
.
path
.
insert
(
0
,
str
(
pathlib
.
Path
(
__file__
)
.
parent
))
from
features
import
count_sensitives
from
log
import
log
from
twitter_session
import
TwitterSession
,
UnexpectedApiError
from
util
import
is_error
,
is_generic_error
from
util
import
is_error
,
is_generic_error
,
UnexpectedApiError
async
def
test
(
session
:
TwitterSession
,
username
:
str
)
->
tuple
[
str
,
d
ict
[
str
,
Any
]]:
async
def
test
(
session
,
username
:
str
)
->
Tuple
[
str
,
D
ict
[
str
,
Any
]]:
profile
:
dict
[
str
,
Any
]
=
{}
profile_raw
=
await
session
.
profile_raw
(
username
)
log
.
info
(
'Testing '
+
str
(
username
))
...
...
twitter_session.py
View file @
53d7ee30
...
...
@@ -9,10 +9,7 @@ from yarl import URL
from
log
import
log
from
tests
import
*
from
util
import
get_nested
,
is_error
class
UnexpectedApiError
(
Exception
):
pass
from
util
import
get_nested
,
is_error
,
UnexpectedApiError
class
TwitterSession
:
twitter_auth_key
=
''
...
...
util.py
View file @
53d7ee30
...
...
@@ -30,3 +30,6 @@ def get_ordered_tweet_ids(obj, filtered=True):
entries
.
sort
(
key
=
lambda
x
:
-
int
(
x
[
"sortIndex"
]))
flat
=
flatten_timeline
(
entries
)
return
[
x
for
x
in
flat
if
not
filtered
or
x
in
obj
[
"globalObjects"
][
"tweets"
]]
class
UnexpectedApiError
(
Exception
):
pass
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment