Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hiro
GetTor
Commits
83d7b1fd
Unverified
Commit
83d7b1fd
authored
Aug 01, 2019
by
Philipp Winter
Browse files
Fix a number of flake8 issues.
Most importantly, fix our precious ASCII art.
parent
a289673e
Changes
1
Show whitespace changes
Inline
Side-by-side
scripts/add_links_to_db
View file @
83d7b1fd
...
...
@@ -17,15 +17,16 @@ from urllib import request
TOR_BROWSER_DOWNLOADS
=
"https://aus1.torproject.org/torbrowser/update_3/release/downloads.json"
def
print_header
():
header
=
"""
header
=
r
"""
__ __
/\ \__ /\ \__
__ __\ \ ,_\\\ \ ,_\ ____ _ __
/'_ `\ /'__`\ \ \/ \ \ \/ / __ `\/\`'__\
/\ \L\ \/\ __/\ \ \_ \ \ \ /\ \L\ \ \ \/
\ \____ \ \____
\\
\__\ \
\
\__\ \_____/\ \_
\
\/___L\ \/____/ \/__/ \/__/\/___/ \/_/
\ \____ \ \____\\
\__\ \ \__\ \_____/\ \_\
\/___L\ \/____/ \/__/ \/__/\/___
_
/ \/_/
/\_____/
\_/___/
...
...
@@ -37,12 +38,14 @@ def print_header():
print
(
"@"
*
100
)
print
(
""
)
def
print_footer
():
print
(
""
)
print
(
"@"
*
100
)
print
(
"@"
*
100
)
print
(
""
)
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
"Tool to create the gettor SQLite database."
...
...
@@ -69,7 +72,6 @@ def main():
"github"
:
"https://github.com/TheTorProject/gettorbrowser/raw/torbrowser-releases/"
}
prefixes
=
{
"osx"
:
"TorBrowser-"
,
"windows"
:
"torbrowser-install-"
,
...
...
@@ -94,7 +96,8 @@ def main():
with
conn
:
c
=
conn
.
cursor
()
"""
Here we drop previous links TABLE but probably it would be better to just update old links to INACTIVE
Here we drop previous links TABLE but probably it would be better to
just update old links to INACTIVE
"""
c
.
execute
(
"DROP TABLE IF EXISTS links"
)
c
.
execute
(
...
...
@@ -107,7 +110,7 @@ def main():
release_link
=
releases
.
get
(
k
).
replace
(
"en-US"
,
l
)
c
.
execute
(
"INSERT INTO links(link, platform, language, arch, version, provider, status)"
"VALUES ('%s', '%s', '%s', '64', '%s', '%s', 'ACTIVE')"
%
(
providers
.
get
(
p
)
+
release_link
,
k
,
l
,
version
,
p
))
"VALUES ('%s', '%s', '%s', '64', '%s', '%s', 'ACTIVE')"
%
(
providers
.
get
(
p
)
+
release_link
,
k
,
l
,
version
,
p
))
if
__name__
==
"__main__"
:
...
...
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