Skip to content

Commit

Permalink
remove defines
Browse files Browse the repository at this point in the history
  • Loading branch information
balrok committed Dec 20, 2011
1 parent afa4813 commit 5a62312
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 49 deletions.
3 changes: 0 additions & 3 deletions config.py
@@ -1,16 +1,13 @@
# -*- coding: utf-8 -*-
# YOU NEED TO COPY THIS FILE TO config.py so that the program uses those values here
import os
from tools.defines import Quality

# caches are only used temporarily - if a download fails, sometimes it can help to delete
# all cachedata - the only negative point in deleting all cachedata is, that the program may be a bit slower on next start
cache_dir = 'cache' # here we write normal html-downloads
cache_dir_for_flv = 'cache2' # here we write flashdownloads

flash_dir = 'flash' # all finished flashdownloads go in this directory and will be deleted from the cachedir
flash_quality = Quality.HIGH # sometimes the videopages offer different qualities - don't change the quality in the middle of a download - the resulting movie will be broken then



import logging
Expand Down
3 changes: 0 additions & 3 deletions config.py.example
Expand Up @@ -2,16 +2,13 @@
# YOU NEED TO COPY THIS FILE TO config.py so that the program uses those values here
import os
from tools.defines import Log
from tools.defines import Quality

# caches are only used temporarily - if a download fails, sometimes it can help to delete
# all cachedata - the only negative point in deleting all cachedata is, that the program may be a bit slower on next start
cache_dir = 'cache' # here we write normal html-downloads
cache_dir_for_flv = 'cache2' # here we write flashdownloads

flash_dir = 'flash' # all finished flashdownloads go in this directory and will be deleted from the cachedir
flash_quality = Quality.HIGH # sometimes the videopages offer different qualities - don't change the quality in the middle of a download - the resulting movie will be broken then



import logging
Expand Down
11 changes: 0 additions & 11 deletions tools/commandline.py
@@ -1,6 +1,5 @@
import sys

import defines as defs
try:
import config
except:
Expand Down Expand Up @@ -34,15 +33,6 @@ def usage():
sys.exit(0)


def set_quality(arg):
global config
if arg:
config.flash_quality = defs.Quality.High
print 'set quality to high'
else:
config.flash_quality = defs.Quality.Low
print 'set quality to low'

def set_cachePort(arg):
global config
print "set cachePort to "+str(arg)
Expand Down Expand Up @@ -163,7 +153,6 @@ def add_to_commands(short, long, param, call, descr):

add_to_commands('h', 'help', None, usage, 'prints this help')
add_to_commands('v', 'version', None, version, 'prints the version')
add_to_commands('q', 'quality', 'BOOL', set_quality, 'quality like in the config-file 0=low, 1=high')
add_to_commands('d', 'dl_instances', 'INT', set_dl_instances, 'set the number of parallel downloads')
add_to_commands('c', 'curses', 'BOOL', set_curses, 'enables curses display or disables if argument is 0 *not yet implemented*')
add_to_commands('t', 'title', 'STRING', set_title, 'the title which is used for this download - mainly for setting the dl filename')
Expand Down
24 changes: 0 additions & 24 deletions tools/defines.py

This file was deleted.

1 change: 0 additions & 1 deletion tools/downloader.py
Expand Up @@ -5,7 +5,6 @@
import os
import time
import sys
import tools.defines as defs
from tools.url import LargeDownload
import logging
log = logging.getLogger('downloader')
Expand Down
1 change: 0 additions & 1 deletion tools/page.py
@@ -1,5 +1,4 @@
import config
import tools.defines as defs
from tools.stream import VideoInfo

log = config.logger['page']
Expand Down
1 change: 0 additions & 1 deletion tools/stream.py
@@ -1,6 +1,5 @@
from tools.url import UrlMgr
from tools.helper import *
import tools.defines as defs
import sys
import logging
from tools.extension import ExtensionRegistrator
Expand Down
6 changes: 1 addition & 5 deletions tools/streams/all.py
Expand Up @@ -2,7 +2,6 @@

from tools.url import UrlMgr, LargeDownload
from tools.helper import textextract, textextractall
import tools.defines as defs
import config
from tools.extension import Extension

Expand Down Expand Up @@ -425,10 +424,7 @@ def get(self, VideoInfo, justId=False, isAvailable=False):
# 73 value="http://ugc04.zeec.de/v/flv1/0x0/9229/99229_yq54tkgU4OVUgDEsxJFUEKMeKoe9YZFA.flv"/>
# 74 <property name="hd_src"
# 75 value="http://ugc02.zeec.de/v/ipod/640x480/9229/99229_yq54tkgU4OVUgDEsxJFUEKMeKoe9YZFA.mp4"/>
if config.flash_quality == defs.Quality.HIGH:
x = url.data.find('name="hd_src"')
else:
x = url.data.find('name="src"')
x = url.data.find('name="hd_src"')
flv_url, x = textextract(url.data, 'value="', '"', x)
self.flvUrl = dlUrl
return self.flvUrl
Expand Down

0 comments on commit 5a62312

Please sign in to comment.