コード例 #1
0
def tag_kword_articles(credentials, items):
    jc = JsonConfig(".kwords")
    config = jc.read()
    kwords = config["keywords"]
    total_uids = []
    for kword, kword_tag in kwords:
        uids = isolate_keyword_articles(items, kword.lower(), kword_tag)
        add_tags(credentials, uids, [kword_tag])
        total_uids.extend(uids)

    return len(total_uids)
コード例 #2
0
ファイル: operators.py プロジェクト: Newky/PocketPy
def tag_kword_articles(credentials, items):
    jc = JsonConfig(".kwords")
    config = jc.read()
    kwords = config["keywords"]
    total_uids = []
    for kword, kword_tag in kwords:
        uids = isolate_keyword_articles(items, kword.lower(), kword_tag)
        add_tags(credentials, uids, [kword_tag])
        total_uids.extend(uids)

    return len(total_uids)
コード例 #3
0
 def setUp(self):
     super(PocketTester, self).setUp()
     jc = JsonConfig(os.path.join(TEST_FILES_DIRECTORY, "sample.json"))
     items = jc.read()
     self.sample_items = {"list": items}
コード例 #4
0
ファイル: tests.py プロジェクト: Newky/PocketPy
 def setUp(self):
     super(PocketTester, self).setUp()
     jc = JsonConfig(os.path.join(TEST_FILES_DIRECTORY, "sample.json"))
     items = jc.read()
     self.sample_items = {"list":items}