Cookie helper and force reload#11
Open
schuellerf wants to merge 11 commits intolmartinking:masterfrom
Open
Conversation
for copying if the programs section is missing - the backslash is missing
for me I think python-gtk2 was ok (but it says GTK3 below)
* act more like a real screen _saver_ percentage calculation is still wrong
lmartinking
requested changes
Oct 17, 2017
Owner
lmartinking
left a comment
There was a problem hiding this comment.
I have a few concerns about the code as it is.
You can also achieve different frames by having a wrapper HTML page using iframes.
Here's an example:
<html>
<head>
<title>Dual View</title>
<style>
html body { padding: 0; margin: 0; overflow: hidden; }
.top { height: 50%; width: 100%; }
.bottom { height: 50%; width: 100%; }
iframe { border: 1px solid black; margin: 0; padding: 0; }
</style>
</head>
<body>
<iframe class="top" src="http://abc.net.au" name="hn-view"></iframe>
<iframe class="bottom" src="http://bing.com" name="slash-view"></iframe>
</body>
</html>
| gi.require_version('Soup', '2.4') | ||
| from gi.repository import Gtk, Gdk, GdkX11, GObject, Soup, WebKit | ||
|
|
||
| cookie_jar="/home/schueller/.webscreensaver-cookies" |
Owner
There was a problem hiding this comment.
You'd need to parameterise this :-)
| sw = Gtk.ScrolledWindow() | ||
| sw.add(view) | ||
|
|
||
| #win = Gtk.Window(Gtk.WindowType.TOPLEVEL) |
| win.add(sw) | ||
| win.show_all() | ||
|
|
||
| #cookiejar = Soup.CookieJar.new() |
| expiry = "-1" if c.get_expires() is None else c.get_expires() | ||
| if type(expiry) is Soup.Date: | ||
| expiry = expiry.to_time_t() | ||
| jar.write("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n".format(c.get_domain(), not c.get_secure(), c.get_path(), c.get_secure(), expiry, c.get_name(), c.get_value())) |
Owner
There was a problem hiding this comment.
If you're writing a CSV/TSV, why not use the CSV writer? Or:
jar.write("\t".join([c.get_domain(), ....]))
| @@ -1,34 +1,152 @@ | |||
| #!/usr/bin/env python2.7 | |||
| #!/usr/bin/env python3 | |||
Owner
There was a problem hiding this comment.
This breaks python 2.7 support...
| win_id = long(int(win_id, 16)) | ||
| win_id = int(win_id, 16) | ||
| if sys.version_info.major < 3: | ||
| win_id = long(win_id) |
Owner
There was a problem hiding this comment.
Is this necessary? Python is fairly flexible with casting around integer (or integer-like) types...
Owner
|
Hi @schuellerf, i have done some spring cleaning and got |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
Thanks for your nice work so far!
if you're interested, I quickly implemented a helper to create a cookie file (e.g. during a login)
and also implemented reloading on connection problems or just on a regular basis
Hmm - I just remembered I need to document that for some session cookies you need to create the cookie file and then start the screensaver with "-cookie-file-readonly" otherwise they are gone again...
Regards
btw. I'll implement a "splitview" to show multiple URLs soonish :)
Then your program perfectly fits our needs...