#============================================ # Probably won't need to change these. # rsync # -a (archive mode) to preserve times / perms # -v (verbose) to output interesting log info # -z (compress) to save bandwidth CMD = ["rsync", "-avz"] targets = {"db": ".cantofeeds", "conf": ".cantoconf"} from canto_next.plugins import check_program check_program("canto-daemon", "canto-remote") if not ENABLED: raise Exception("Plugin disabled.") from canto_next.hooks import on_hook, call_hook from canto_next.canto_backend import DaemonBackendPlugin from canto_next.remote import DaemonRemotePlugin from canto_next.config import parse_locks, parse_unlocks, config from canto_next.locks import config_lock, feed_lock from canto_next.feed import wlock_all, wunlock_all, rlock_all, runlock_all, allfeeds from canto_next.tag import alltags from tempfile import mkstemp import subprocess
# Canto Default Theme # Defined as a plugin to use as a base for other themes. FORCE_COLORS = False FORCE_STYLE = False from canto_next.plugins import check_program check_program("canto-curses") from canto_curses.story import StoryPlugin from canto_curses.tag import TagPlugin from canto_curses.theme import prep_for_display from canto_curses.color import cc cmds = [] if FORCE_COLORS: cmds.append("reset-config color") if FORCE_STYLE: cmds.append("reset-config style") class CantoThemeStoryDefault(StoryPlugin): def __init__(self, story): self.story = story self.plugin_attrs = { "eval" : self.eval } def eval(self): story = self.story s = ""
# Probably won't need to change these. # rsync # -a (archive mode) to preserve times / perms # -v (verbose) to output interesting log info # -z (compress) to save bandwidth CMD = [ "rsync", "-avz"] targets = { "db" : ".cantofeeds", "conf" : ".cantoconf" } from canto_next.plugins import check_program check_program("canto-daemon", "canto-remote") if not ENABLED: raise Exception("Plugin disabled.") from canto_next.hooks import on_hook, call_hook from canto_next.canto_backend import DaemonBackendPlugin from canto_next.remote import DaemonRemotePlugin from canto_next.config import parse_locks, parse_unlocks, config from canto_next.locks import config_lock, feed_lock from canto_next.feed import wlock_all, wunlock_all, rlock_all, runlock_all, allfeeds from tempfile import mkstemp import subprocess import logging
PASSWORD = "******" # You don't *have* to change these, but the API is rate limited. So if you want # to avoid rate limit issues, register your own application Preferences -> # Developer options on the Inoreader site and replace these. APP_ID = "1000001299" APP_KEY = "i0UOUtLQjj2WTre8WA3a9GWt_cgDhpkO" BASE_URL = "https://www.inoreader.com/reader/" # === You shouldn't have to change anything past this line. === from canto_next.plugins import check_program check_program("canto-daemon") from canto_next.fetch import DaemonFetchThreadPlugin from canto_next.feed import DaemonFeedPlugin, allfeeds from canto_next.hooks import call_hook, on_hook from canto_next.config import config from urllib.parse import urlencode, quote import traceback import requests import logging import time import json log = logging.getLogger("SYNC-INOREADER")
PREPEND_SCORE = True # PREPEND_SUBREDDIT, if true will add the [subreddit] to the entry title. PREPEND_SUBREDDIT = True # EXTRA_LOG_OUTPUT, if true will log non-error stuff with -v. EXTRA_LOG_OUTPUT = False # You shouldn't have to change anything beyond this line. from canto_next.plugins import check_program check_program("canto-daemon") from canto_next.fetch import DaemonFetchThreadPlugin from canto_next.feed import DaemonFeedPlugin from canto_next.transform import transform_locals, CantoTransform import urllib.request, urllib.error, urllib.parse import logging import time import json import re log = logging.getLogger("REDDIT") def debug(message): if EXTRA_LOG_OUTPUT:
# Favorite Plugin # by Jack Miller # v1.0 # This plugin allows certain items to be tagged as 'user:favorite' and then a # custom style to be applied to those items. from canto_next.plugins import check_program check_program("canto-curses") from canto_curses.taglist import TagListPlugin from canto_curses.story import StoryPlugin from canto_curses.command import register_commands class StoryFavorite(StoryPlugin): def __init__(self, story): self.plugin_attrs = {} story.pre_format += "%?{'user:favorite' in ut}(*:)" class TagListFavorite(TagListPlugin): def __init__(self, taglist): self.plugin_attrs = {} cmds = { "favorite" : (self.cmd_favorite, ["item-list"], "Favorite items."), } register_commands(taglist, cmds) self.taglist = taglist