I've made some progress.
Direct Download:
http://dl.getdropbox.com/u/124437/delug ... limiter.py
PasteSite:
http://pastesite.com/2267
I have some questions on how to proceed.
First, why do I keep seeing set_core_uri() in all the examples? What does this really do in terms of the plugin?
For setting the max_bandwith_limit
How should I set and store it's configuration value? Can/Should I create a new string variable using set_config ?
For storing the data transfer log
How should I store this dictionary so that it can be recalled? vonck7 pointed me in the direction of pickle which I understand serializes the data. But how will this be stored so that it can be repetitively accessed by the program?
Lastly, I need some help with the logic for the plugin. How should I go about storing the data transferred? I was thinking maybe storing the data for each half hour, so then if it reaches its max bandwith for the past 24 hours, it won't start again until the next half hour block. I guess I'd have to create a dictionary within the log dictionary I'm already creating so it'd basically be a multi-dimensional dictionary. e.g.
data_log{ 1:{0000:242342}, 2:{0030:724722}, 3:{0100:357273} 4:{0130:1275828} }
Where 1, 2, 3, 4 are the torrent ids
0000, 0030, 0100, 0130 are the time blocks (12:00AM-12:30AM, 12:30AM-1:00AM, 1:00AM-1:30AM, 1:30AM-2:00AM
242342, 724722, 357273, 1275838 are the total data transferred in its respective time blocks
And then after I got the initial idea working, I thought it'd be nice to be able to specify individual bandwith limits for downloading and uploading, so I guess another dimension would be added to the scheme so that it looked like:
data_log{ 1:{0000:{"upload":124273,"upload":137247}}, 2:{0030:{"upload":324724,"download":423473}}, 3:{0100:{"upload":147237, "download":162374}}, 4:{0130:{"upload":572357, "download":575838}} }
If anyone has any other suggestions I'm more than open to them. I'm not experienced with python, so I'm trying to learn more of the language as I write this plugin.