瀏覽代碼

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

master
Abrax 2 年之前
父節點
當前提交
d9171f5426
共有 6 個文件被更改,包括 22 次插入3 次删除
  1. 4
    2
      README.md
  2. 二進制
      dist/lizard-0.4-py3-none-any.whl
  3. 1
    1
      lizard/web_methods.py
  4. 0
    0
      lizard_tests/__init__.py
  5. 17
    0
      lizard_tests/test_parse_url.py
  6. 0
    0
      setup.py

+ 4
- 2
README.md 查看文件

@@ -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:

二進制
dist/lizard-0.4-py3-none-any.whl 查看文件


+ 1
- 1
lizard/web_methods.py 查看文件

@@ -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 查看文件


+ 17
- 0
lizard_tests/test_parse_url.py 查看文件

@@ -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 查看文件


Loading…
取消
儲存