Beispiel #1
0
	def test_default_loading(self):
		settings = utils.load_config()

		self.assertEqual(settings['port'], 50505)
		self.assertEqual(settings['download-dir'], 'downloads')
		self.assertEqual(settings['captcha-api-key'], 'xyz')
		self.assertTrue(settings['parallel-download-num'], 2)
Beispiel #2
0
	def test_normal_loading(self):
		settings = utils.load_config()

		self.assertEqual(settings['port'], 42424)
		self.assertEqual(settings['download-dir'], 'somewhere')
		self.assertEqual(settings['captcha-api-key'], 'foo')
		self.assertTrue(settings['parallel-download-num'], 1)
    def test_default_loading(self):
        settings = utils.load_config()

        self.assertEqual(settings['port'], 50505)
        self.assertEqual(settings['download-dir'], 'downloads')
        self.assertEqual(settings['captcha-api-key'], 'xyz')
        self.assertTrue(settings['parallel-download-num'], 2)
    def test_normal_loading(self):
        settings = utils.load_config()

        self.assertEqual(settings['port'], 42424)
        self.assertEqual(settings['download-dir'], 'somewhere')
        self.assertEqual(settings['captcha-api-key'], 'foo')
        self.assertTrue(settings['parallel-download-num'], 1)
Beispiel #5
0
    def __init__(self, path):
        self.path = utils.set_file(path)

        self.data = []  # list of Download objects
        self.get_data()  # already stores data in self.data

        self.parallel_download_num = 0

        self.settings = utils.load_config()
Beispiel #6
0
	def __init__(self, path):
		self.path = utils.set_file(path)

		self.data = [] # list of Download objects
		self.get_data() # already stores data in self.data

		self.parallel_download_num = 0

		self.settings = utils.load_config()
Beispiel #7
0
	def execute(self, data=None):
		if self.state == "start":
			self.state = "get_obj"
			return "return", "config"
		elif self.state == "get_obj":
			settings = utils.load_config()

			answ = "Current configuration:\n"
			for key, val in sorted(settings.items()):
				answ += "%s: %s\n" % (key, val)
			return answ
Beispiel #8
0
    def execute(self, data=None):
        if self.state == "start":
            self.state = "get_obj"
            return "return", "config"
        elif self.state == "get_obj":
            settings = utils.load_config()

            answ = "Current configuration:\n"
            for key, val in sorted(settings.items()):
                answ += "%s: %s\n" % (key, val)
            return answ
Beispiel #9
0
	def __init__(self, name, link_list, passwd = None):
		self.name = name
		self.links = link_list
		self.passwd = passwd

		self.settings = utils.load_config();

		self.dw_dir = utils.set_dir(os.path.join(self.settings["download-dir"], self.name.replace(" ", "_")))
		self.log_dir = utils.set_dir(os.path.join(self.dw_dir, "logs"))

		self.saver = None

		self.cur_item = None

		self.acquired = False
Beispiel #10
0
    def __init__(self, name, link_list, passwd=None):
        self.name = name
        self.links = link_list
        self.passwd = passwd

        self.settings = utils.load_config()

        self.dw_dir = utils.set_dir(
            os.path.join(self.settings["download-dir"],
                         self.name.replace(" ", "_")))
        self.log_dir = utils.set_dir(os.path.join(self.dw_dir, "logs"))

        self.saver = None

        self.cur_item = None

        self.acquired = False