summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add [scripting_and_scheduling] section to segget.conf file.Kostyantyn Ovechko2010-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [scripting_and_scheduling] Segget provides Python scripting functionalyty to support scheduling. Each time segget tries to start a new connection certain network it calls a python script (client.py) to accept or reject this connection and if necessary adjusts its settings. PYTHON_PATH Define path to python Default: python_path=/usr/bin/python SCRIPTS_DIR Define a path to the dir with python scripts. Before establishing connection for a particular segment via network# segget checks SCRIPTS_DIR. If SCRIPTS_DIR contains net#.py file, segget will launch schedule() function from this file to apply settings for connetion and accept or reject this segment for the moment. net#.py file is a python script file with a user-writen schedule() function. It's necessary to import functions before using get("variable"), set("variable",value), accept_segment() and reject_segment() in schedule(). get() function can obtain values for the following variables: connection.num, connection.url, connection.max_speed_limit, network.num, network.mode, network.active_connections_count, distfile.name, distfile.size, distfile.dld_segments_count, distfile.segments_count, distfile.active_connections_count, segment.num, segment.try_num, segment.size, segment.range set() function can change connection.max_speed_limit, see example: -----------------EXAMPLE STARTS----------------- from functions import * import time; def schedule(): localtime = time.localtime(time.time()); hour=localtime[3]; # disable downloading distfiles that have size more than 5 000 000 bytes # from 8-00 to 22-00. if hour>8 and hour<22 and (get("distfile.size"))>5000000: print "reject because distfile is too big" reject_segment() # set speed limit 50 000 cps for distfiles larger than 1 000 000 bytes if get("distfile.size")>1000000: print "limit connection speed" set(connection.max_speed_limit, 50000) accept_segment() -----------------EXAMPLE ENDS----------------- From example above localtime returns following tuple: Index Attributes Values 0 tm_year e.i.: 2008 1 tm_mon 1 to 12 2 tm_mday 1 to 31 3 tm_hour 0 to 23 4 tm_min 0 to 59 5 tm_sec 0 to 61 (60 or 61 are leap-seconds) 6 tm_wday 0 to 6 (0 is Monday) 7 tm_yday 1 to 366 (Julian day) 8 tm_isdst -1, 0, 1, -1 means library determines DST Therefore localtime[3] provides hours. Segment will be accecpted by default if it was neither accepted nor rejected during the schedule() function. sagget saves logs of resulting stdout and stderr in the log folder separatly for each network. Hence, if there's an error in net3.py file python error message would be saved to net3_script_stderr.log. Results of print would be saved in net3_script_stdout.log. Default: scripts_dir=./scripts SCRIPT_SOCKET_PATH Segget uses AF_UNIX domain sockets for communication with python. Specify path for the socket on your filesystem. Default: script_socket_path=/tmp/segget_script_socket
* Add request tool.Kostyantyn Ovechko2010-07-241-1/+6
| | | | | Request tool reads list of distfiles from ./pkg.list file and requests seggetd daemon to download distfiles from the list.
* Add command line arguments: --no-daemon and --conf-dir=specify_conf_dir_hereKostyantyn Ovechko2010-07-231-1/+2
| | | | | Arguments are optional. If no arguments provided, segget will run in a daemon mode and use /etc/seggetd dir to read configuration files.
* Add daemon mode to seggetKostyantyn Ovechko2010-07-231-0/+8
|
* Fix: warnings with unused variablesKostyantyn Ovechko2010-07-171-0/+1
|
* Fix: Generate one .o per .cpp, and link them together.Kostyantyn Ovechko2010-07-161-16/+15
|
* Add to segget.conf file section [provide_proxy_fetcher_to_others].Kostyantyn Ovechko2010-07-141-2/+2
| | | | | | | | | | | | | | | | | | | | | NOTE: Proxy-fetcher downloads distfiles requested by other segget daemons. File will be ignored if it's already downloaded. TO-DO: Proxy-fetcher needs to check if distfile is already in the download list. [provide_proxy_fetcher_to_others] PROVIDE_PROXY_FETCHER_IP Define an ip address segget will use to provide access for tuiclients. The parameter should be a string holding your host dotted IP address. Default: provide_proxy_fetcher_ip=127.0.0.1 PROVIDE_PROXY_FETCHER_PORT Define a port segget will use to provide access for tuiclients. The parameter should be an integer. Minimum value: 1 Maximum value: 65535 Default: provide_proxy_fetcher_port=9777
* Add scrolling to tuiclientKostyantyn Ovechko2010-07-121-1/+1
|
* Separate text based ui from segget into a tuiclient.Kostyantyn Ovechko2010-07-111-0/+2
| | | | | Prepare segget for daemon phase. Segget gets ui_server interface and tuiclient in curses as a separate app.
* Move show_progress() to a threadKostyantyn Ovechko2010-07-101-0/+1
|
* Failprove .cpp files and log errors to error.logKostyantyn Ovechko2010-07-051-0/+63