1
0
mirror of https://github.com/instaloader/instaloader.git synced 2024-07-14 23:00:06 +02:00

doc: Minor style-related changes to code examples

This commit is contained in:
Alexander Graf 2020-06-03 18:03:01 +02:00
parent 27b7c98be2
commit 689dd3613b
3 changed files with 22 additions and 18 deletions

View File

@ -17,15 +17,16 @@ code {
.highlight pre {
padding: 0.7em;
color: #fff; }
.highlight .c1 {
.highlight .c1, .highlight .k, .highlight .kn, .highlight .ow {
color: #008d06; }
.highlight .k, .highlight .kn, .highlight .ow {
color: #f48400;
font-weight: bold; }
.highlight .nb {
.highlight .nb, .highlight .ne, .highlight .nf, .highlight .vm {
color: #f48400; }
.highlight .s1, .highlight .s2, .highlight .mi {
.highlight .s1, .highlight .s2, .highlight .sa, .highlight .se, .highlight .si, .highlight .mi {
color: #ff7efd; }
.highlight .c1, .highlight .nf, .highlight .sa, .highlight .se, .highlight .si {
font-style: italic; }
.highlight .k, .highlight .kn, .highlight .ow {
font-weight: bold; }
.doc-content {
padding-top: 0.5em;

View File

@ -36,22 +36,25 @@ code {
color: #fff;
}
.c1 {
.c1, .k, .kn, .ow {
color: $color_instaloader_main
}
.k, .kn, .ow {
color: $color_instaloader_accent;
font-weight: bold
}
.nb {
.nb, .ne, .nf, .vm {
color: $color_instaloader_accent
}
.s1, .s2, .mi {
.s1, .s2, .sa, .se, .si, .mi {
color: $color_instaloader_hyper
}
.c1, .nf, .sa, .se, .si {
font-style: italic;
}
.k, .kn, .ow {
font-weight: bold
}
}
.doc-content {

View File

@ -10,7 +10,7 @@ except ModuleNotFoundError:
raise SystemExit("Instaloader not found.\n pip install [--user] instaloader")
def get_cookiefile() -> str:
def get_cookiefile():
default_cookiefile = {
"Windows": "~/AppData/Roaming/Mozilla/Firefox/Profiles/*/cookies.sqlite",
"Darwin": "~/Library/Application Support/Firefox/Profiles/*.default/cookies.sqlite",
@ -22,7 +22,7 @@ def get_cookiefile() -> str:
def import_session(cookiefile, sessionfile):
print(f"Using cookies from {cookiefile}.")
print("Using cookies from {}.".format(cookiefile))
conn = connect(cookiefile)
try:
cookie_data = conn.execute(
@ -37,7 +37,7 @@ def import_session(cookiefile, sessionfile):
username = instaloader.test_login()
if not username:
raise SystemExit("Not logged in. Are you logged in successfully in Firefox?")
print(f"Imported session cookie for {username}.")
print("Imported session cookie for {}.".format(username))
instaloader.context.username = username
instaloader.save_session_to_file(sessionfile)
@ -50,4 +50,4 @@ if __name__ == "__main__":
try:
import_session(args.cookiefile or get_cookiefile(), args.sessionfile)
except (ConnectionException, OperationalError) as e:
raise SystemExit(f"Cookie import failed: {e}")
raise SystemExit("Cookie import failed: {}".format(e))