|
@@ -22,7 +22,6 @@ |
|
|
|
|
|
|
|
|
from cookielib import LWPCookieJar, LoadError |
|
|
from cookielib import LWPCookieJar, LoadError |
|
|
import errno |
|
|
import errno |
|
|
from getpass import getpass |
|
|
|
|
|
from os import chmod, path |
|
|
from os import chmod, path |
|
|
from platform import python_version |
|
|
from platform import python_version |
|
|
import stat |
|
|
import stat |
|
@@ -87,8 +86,8 @@ class SitesDB(object): |
|
|
if e.errno == errno.ENOENT: # "No such file or directory" |
|
|
if e.errno == errno.ENOENT: # "No such file or directory" |
|
|
# Create the file and restrict reading/writing only to the |
|
|
# Create the file and restrict reading/writing only to the |
|
|
# owner, so others can't peak at our cookies: |
|
|
# owner, so others can't peak at our cookies: |
|
|
open(cookie_file, "w").close() |
|
|
|
|
|
chmod(cookie_file, stat.S_IRUSR|stat.S_IWUSR) |
|
|
|
|
|
|
|
|
open(self._cookie_file, "w").close() |
|
|
|
|
|
chmod(self._cookie_file, stat.S_IRUSR|stat.S_IWUSR) |
|
|
else: |
|
|
else: |
|
|
raise |
|
|
raise |
|
|
|
|
|
|
|
@@ -344,7 +343,6 @@ class SitesDB(object): |
|
|
assert_edit = config.wiki.get("assert") |
|
|
assert_edit = config.wiki.get("assert") |
|
|
maxlag = config.wiki.get("maxlag") |
|
|
maxlag = config.wiki.get("maxlag") |
|
|
wait_between_queries = config.wiki.get("waitTime", 5) |
|
|
wait_between_queries = config.wiki.get("waitTime", 5) |
|
|
logger = self._logger.getChild(name) |
|
|
|
|
|
search_config = config.wiki.get("search") |
|
|
search_config = config.wiki.get("search") |
|
|
|
|
|
|
|
|
# Create a Site object to log in and load the other attributes: |
|
|
# Create a Site object to log in and load the other attributes: |
|
@@ -352,7 +350,7 @@ class SitesDB(object): |
|
|
login=login, cookiejar=cookiejar, user_agent=user_agent, |
|
|
login=login, cookiejar=cookiejar, user_agent=user_agent, |
|
|
use_https=use_https, assert_edit=assert_edit, |
|
|
use_https=use_https, assert_edit=assert_edit, |
|
|
maxlag=maxlag, wait_between_queries=wait_between_queries, |
|
|
maxlag=maxlag, wait_between_queries=wait_between_queries, |
|
|
logger=logger, search_config=search_config) |
|
|
|
|
|
|
|
|
search_config=search_config) |
|
|
|
|
|
|
|
|
self._add_site_to_sitesdb(site) |
|
|
self._add_site_to_sitesdb(site) |
|
|
self._sites[site.name()] = site |
|
|
self._sites[site.name()] = site |
|
|