Skip to content

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
mavit committed Nov 1, 2010
0 parents commit c49f09f
Show file tree
Hide file tree
Showing 18 changed files with 646 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
dist/
7 changes: 7 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TrafficLimits is a plugin for the Deluge bittorrent client
(http://deluge-torrent.org/).

It will pause all torrents if more than a set amount of data is uploaded
or downloaded.

TrafficLimits can be found at http://github.com/mavit/deluge-trafficlimits.
3 changes: 3 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Add documentation.
* Add a user interface.
* Make more robust.
10 changes: 10 additions & 0 deletions TrafficLimits.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Metadata-Version: 1.0
Name: TrafficLimits
Version: 0.1
Summary: Restrict the maximum total upload/download during certain time periods.
Home-page: http://github.com/mavit/deluge-trafficlimits
Author: Peter Oliver
Author-email: [email protected]
License: GPLv3
Description: Restrict the maximum total upload/download during certain time periods.
Platform: UNKNOWN
12 changes: 12 additions & 0 deletions TrafficLimits.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
README
setup.py
TrafficLimits.egg-info/PKG-INFO
TrafficLimits.egg-info/SOURCES.txt
TrafficLimits.egg-info/dependency_links.txt
TrafficLimits.egg-info/entry_points.txt
TrafficLimits.egg-info/top_level.txt
trafficlimits/__init__.py
trafficlimits/common.py
trafficlimits/core.py
trafficlimits/gtkui.py
trafficlimits/webui.py
1 change: 1 addition & 0 deletions TrafficLimits.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

8 changes: 8 additions & 0 deletions TrafficLimits.egg-info/entry_points.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

[deluge.plugin.core]
TrafficLimits = trafficlimits:CorePlugin
[deluge.plugin.gtkui]
TrafficLimits = trafficlimits:GtkUIPlugin
[deluge.plugin.web]
TrafficLimits = trafficlimits:WebUIPlugin

1 change: 1 addition & 0 deletions TrafficLimits.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
trafficlimits
7 changes: 7 additions & 0 deletions create_dev_link.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
cd /home/mavit/src/trafficlimits
mkdir temp
export PYTHONPATH=./temp
python setup.py build develop --install-dir ./temp
cp ./temp/TrafficLimits.egg-link /home/mavit/.config/deluge/plugins
rm -fr ./temp
73 changes: 73 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#
# setup.py
#
# Copyright (C) 2009 Peter Oliver <[email protected]>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <[email protected]>
# Copyright (C) 2007-2009 Andrew Resch <[email protected]>
# Copyright (C) 2009 Damien Churchill <[email protected]>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#

from setuptools import setup

__plugin_name__ = "TrafficLimits"
__author__ = "Peter Oliver"
__author_email__ = "[email protected]"
__version__ = "0.1"
__url__ = "http://github.com/mavit/deluge-trafficlimits"
__license__ = "GPLv3"
__description__ = "Restrict the maximum total upload/download during certain time periods."
__long_description__ = """"""
__pkg_data__ = {__plugin_name__.lower(): ["template/*", "data/*"]}

setup(
name=__plugin_name__,
version=__version__,
description=__description__,
author=__author__,
author_email=__author_email__,
url=__url__,
license=__license__,
long_description=__long_description__ if __long_description__ else __description__,

packages=[__plugin_name__.lower()],
package_data = __pkg_data__,

entry_points="""
[deluge.plugin.core]
%s = %s:CorePlugin
[deluge.plugin.gtkui]
%s = %s:GtkUIPlugin
[deluge.plugin.web]
%s = %s:WebUIPlugin
""" % ((__plugin_name__, __plugin_name__.lower())*3)
)
58 changes: 58 additions & 0 deletions trafficlimits/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#
# __init__.py
#
# Copyright (C) 2009 Peter Oliver <[email protected]>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <[email protected]>
# Copyright (C) 2007-2009 Andrew Resch <[email protected]>
# Copyright (C) 2009 Damien Churchill <[email protected]>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#

from deluge.plugins.init import PluginInitBase

class CorePlugin(PluginInitBase):
def __init__(self, plugin_name):
from core import Core as _plugin_cls
self._plugin_cls = _plugin_cls
super(CorePlugin, self).__init__(plugin_name)

class GtkUIPlugin(PluginInitBase):
def __init__(self, plugin_name):
from gtkui import GtkUI as _plugin_cls
self._plugin_cls = _plugin_cls
super(GtkUIPlugin, self).__init__(plugin_name)

class WebUIPlugin(PluginInitBase):
def __init__(self, plugin_name):
from webui import WebUI as _plugin_cls
self._plugin_cls = _plugin_cls
super(WebUIPlugin, self).__init__(plugin_name)
42 changes: 42 additions & 0 deletions trafficlimits/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# common.py
#
# Copyright (C) 2009 Peter Oliver <[email protected]>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <[email protected]>
# Copyright (C) 2007-2009 Andrew Resch <[email protected]>
# Copyright (C) 2009 Damien Churchill <[email protected]>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# deluge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with deluge. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the OpenSSL
# library.
# You must obey the GNU General Public License in all respects for all of
# the code used other than OpenSSL. If you modify file(s) with this
# exception, you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
#

def get_resource(filename):
import pkg_resources, os
return pkg_resources.resource_filename("trafficlimits", os.path.join("data", filename))
Loading

0 comments on commit c49f09f

Please sign in to comment.