Skip to content

Instantly share code, notes, and snippets.

View gazpachoking's full-sized avatar

Chase Sterling gazpachoking

View GitHub Profile
[
{
"description": "remote ref",
"schema": {"$ref": "http://localhost:1234/integer.json"},
"tests": [
{
"description": "remote ref valid",
"data": 1,
"valid": true
},
@gazpachoking
gazpachoking / set_torrent_comment.py
Created November 13, 2012 18:48
Plugin to set the comment in a torrent
import logging
from flexget.plugin import priority, register_plugin
from flexget.utils.template import RenderError
log = logging.getLogger('set_torrent_comment')
class SetTorrentComment(object):
"""
Changes comment in torrent file
@gazpachoking
gazpachoking / gist:3984489
Created October 31, 2012 02:38
deluge stable sort
Index: deluge/ui/gtkui/listview.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+># -*- coding: utf-8 -*-\n#\n# listview.py\n#\n# Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com>\n#\n# Deluge is free software.\n#\n# You may redistribute it and/or modify it under the terms of the\n# GNU General Public License, as published by the Free Software\n# Foundation; either version 3 of the License, or (at your option)\n# any later version.\n#\n# deluge is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n# See the GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with deluge. If not, write to:\n# The Free Software Foundation, Inc.,\n# 51 Franklin Street, Fifth Floor\n# Boston, MA 0
@gazpachoking
gazpachoking / gist:3908383
Created October 17, 2012 21:33
npyscreen test
import npyscreen
tree_data = npyscreen.NPSTreeData()
tree_data.newChild(content={'a': 1})
tree_data.newChild(content={'b': 2})
class MyTreeLineAnnotated(npyscreen.TreeLineAnnotated):
def getAnnotationAndColor(self):
# AHH, self.value is an empty str, this fails.
content = self.value.getContent()
@gazpachoking
gazpachoking / gist:3889680
Created October 14, 2012 20:14
seed series databas
presets:
presetwithyourseriesconfig:
# your series config, (or import_series) goes here
tasks:
seed_series_db:
find:
regexp: .*(avi|mkv)$
path: /my/series
preset: presetwithyourseriesconfig
manual: yes
@gazpachoking
gazpachoking / my_filters.py
Created March 6, 2012 20:41
FlexGet plugin which adds custom jinja filters
"""
This plugin just registers more functions as jinja filters. You can then use the filters from any
jinja template in FlexGet like normal. e.g. {{afield|myfilter}}
"""
import logging
log = logging.getLogger('my_filters')
def filter_myfilter(val):
import logging
from BeautifulSoup import BeautifulSoup
from flexget.utils import requests
from flexget.entry import Entry
from flexget import plugin
from flexget.utils.cached_input import cached
log = logging.getLogger('pogdesign')
class InputPogDesign(object):
@gazpachoking
gazpachoking / gist:1700518
Created January 29, 2012 20:35
no ignore_case_property on series name
Index: flexget/plugins/cli/series.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- flexget/plugins/cli/series.py (revision 2688)
+++ flexget/plugins/cli/series.py (revision )
@@ -40,7 +40,7 @@
session = Session()
@gazpachoking
gazpachoking / gist:1699957
Created January 29, 2012 18:16
Adding some indexes to FlexGet db
Index: flexget/utils/simple_persistence.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- flexget/utils/simple_persistence.py (revision 2688)
+++ flexget/utils/simple_persistence.py (revision )
@@ -10,7 +10,7 @@
import logging
from datetime import datetime
@gazpachoking
gazpachoking / combine.py
Created October 10, 2011 03:32
Generic combining plugin (now added to repo as 'sequence')
import logging
from flexget.plugin import register_plugin, get_plugin_by_name, get_plugin_keywords, get_phases_by_plugin, phase_methods
log = logging.getLogger('combine')
class PluginCombine(object):
""" Allows the same plugin to be configured multiple times in a feed.
Example: