Compare commits

..

No commits in common. "740a2705ee889203d56d18607825d6d346adc2a7" and "6e6803fcff63b542caceef807aa76fc7c57351d3" have entirely different histories.

2 changed files with 8 additions and 18 deletions

View file

@ -5,6 +5,11 @@ Spot the difference on the web.
Tired of clicking F5 waiting for a change on a web page? Define a list of pages to watch, and receive an email when something has changed.
# Demo
See [https://ismito.it:3210/](https://ismito.it:3210/) (you can only add \*.wikipedia.org pages, there)
## Install, run, develop and debug
## Docker

View file

@ -196,17 +196,7 @@ def run_job(id_=None, force=False, *args, **kwargs):
req_path = urllib.parse.urlparse(req.url).path
base_name = os.path.basename(req_path) or 'index.html'
def _commit(id_, filename, content, queue):
try:
os.chdir('storage/%s' % id_)
except Exception as e:
logger.info('unable to move to storage/%s directory: %s; trying to create it...' % (id_, e))
_created = False
try:
_created = git_create_repo(id_)
except Exception as e:
logger.info('unable to move to storage/%s directory: %s; unable to create it' % (id_, e))
if not _created:
return False
os.chdir('storage/%s' % id_)
current_lines = 0
if os.path.isfile(filename):
with open(filename, 'r') as fd:
@ -338,8 +328,7 @@ def get_history(id_, limit=None, add_info=False):
def _history(id_, limit, queue):
try:
os.chdir('storage/%s' % id_)
except Exception as e:
logger.info('unable to move to storage/%s directory: %s' % (id_, e))
except:
return queue.put(b'')
cmd = [GIT_CMD, 'log', '--pretty=oneline', '--shortstat']
if limit is not None:
@ -394,11 +383,7 @@ def get_diff(id_, commit_id='HEAD', old_commit_id=None):
:returns: information about the schedule and the diff between commits
:rtype: dict"""
def _history(id_, commit_id, old_commit_id, queue):
try:
os.chdir('storage/%s' % id_)
except Exception as e:
logger.info('unable to move to storage/%s directory: %s' % (id_, e))
return queue.put(b'')
os.chdir('storage/%s' % id_)
p = subprocess.Popen([GIT_CMD, 'diff', old_commit_id or '%s~' % commit_id, commit_id],
stdout=subprocess.PIPE)
stdout, _ = p.communicate()