Sfoglia il codice sorgente

Committing months after the changes were made, I have no fucking clue what exactly I did.

master
Abrax 2 anni fa
parent
commit
d9171f5426

+ 4
- 2
README.md Vedi File

@@ -21,9 +21,11 @@ You can call `lizard r` to refresh threads currently in the database, and see th

## Changelog

### 0.5 (planned)
### 1.0 (planned)

### 0.4 (in development)
### 0.5 (in development)

### 0.4 (current)

Command syntax changes:
- Listing threads:

BIN
dist/lizard-0.4-py3-none-any.whl Vedi File


+ 1
- 1
lizard/web_methods.py Vedi File

@@ -15,7 +15,7 @@ def fetch_and_parse_thread_json(board, thread_no, use_onion_link=False):
url = generate_thread_json_url(board, thread_no, use_onion_link=use_onion_link)
p = generate_json_path(board, thread_no)

if not download_file(url, p, use_onion_link=use_onion_link):
if not download_file(url, p):
return None
else:
return json.load(open(p))

+ 0
- 0
lizard_tests/__init__.py Vedi File


+ 17
- 0
lizard_tests/test_parse_url.py Vedi File

@@ -0,0 +1,17 @@
from unittest import TestCase

from lizard import db_methods


class TestParse_url(TestCase):
def test_parse_url(self):
urls = {
'http://8ch.net/b/res/123.html#456': ['b', '123', '456'],
'https://8ch.net/b/res/123.html#456': ['b', '123', '456'],
'http://oxwugzccvk3dk6tj.onion/b/res/123.html#456': ['b', '123', '456']
}

for u in urls:
result = db_methods.parse_url(u)

self.assertListEqual(result, urls[u])

+ 0
- 0
setup.py Vedi File


Loading…
Annulla
Salva