[from now] 2014/05/29 22:12:26

diff --git a/loader/interfaces/creeperrepo_loader.py b/loader/interfaces/creeperrepo_loader.py
index 8a4dabd..87dda4c 100644
--- a/loader/interfaces/creeperrepo_loader.py
+++ b/loader/interfaces/creeperrepo_loader.py
@@ -28,8 +28,6 @@ class loader_creeperrepo:

 		for modpack in data.findall('modpack'):

-			if modpack.get('serverPack') == "": continue
-
 			if modpack.get('repoVersion') != None:
 				version = modpack.get('repoVersion')
 			else:
diff --git a/loader/loader.py b/loader/loader.py
index 17bfa40..c8c3e19 100644
--- a/loader/loader.py
+++ b/loader/loader.py
@@ -9,7 +9,7 @@ def loadSources():

 	import glob, json

-	files = glob.glob(_path + '/../sources/*.json')
+	files = glob.glob(_path + '/../sources/creeperrepo.json')
 	output = []

 	for f in files:
@@ -50,24 +50,51 @@ def load():
 	adder = yggdrasil.Yggdrasil()

 	for source in sources:
+		if source['name'] != 'creeperrepo' :

-		jar_obj = adder.addJar(source)
+			jar_obj = adder.addJar(source)

-		for channel_data in source['channels']:
-			channel = adder.addChannel(channel_data, jar_obj)
-			l = getLoader(channel_data['interface'])
+			for channel_data in source['channels']:
+				channel = adder.addChannel(channel_data, jar_obj)
+				l = getLoader(channel_data['interface'])

-			sys.stdout.write("\n\nLoading builds for %s" % (source['name'] + '#' + channel_data['name']))
+				sys.stdout.write("\n\nLoading builds for %s" % (source['name'] + '#' + channel_data['name']))

-			if not l: continue;
+				if not l: continue;

-			data = getLastBuild(channel)
-			last_build = 0
-			if data:
-				last_build = data.build
+				data = getLastBuild(channel)
+				last_build = 0
+				if data:
+					last_build = data.build

-			for build in l.load(channel_data, last_build):
-				adder.addBuild(build, channel)
+				for build in l.load(channel_data, last_build):
+					adder.addBuild(build, channel)
+			adder.commit()
+			sys.stdout.write("\n\n")
+		else:
+			for channel_data in source['channels']:
+				interface = channel_data['interface']
+				l = getLoader(channel_data['interface'])

-	adder.commit()
-	sys.stdout.write("\n\n")
\ No newline at end of file
+				for modpack in l.getXML(channel_data['interface']).findall('modpack'):
+
+					if modpack.get('serverPack') == "": continue
+
+					print modpack.get('name')
+
+					jar_obj = adder.addJarName(modpack.get('name'))
+					channel = adder.addChannel(channel_data, jar_obj)
+
+					sys.stdout.write("\n\nLoading builds for %s" % (source['name'] + '#' + channel_data['name']))
+
+					if not l: continue;
+
+					data = getLastBuild(channel)
+					last_build = 0
+					if data:
+						last_build = data.build
+
+					for build in l.load(channel_data, last_build):
+						adder.addBuild(build, channel)
+			adder.commit()
+			sys.stdout.write("\n\n")
diff --git a/loader/yggdrasil.py b/loader/yggdrasil.py
index 233b7ab..43d06e1 100644
--- a/loader/yggdrasil.py
+++ b/loader/yggdrasil.py
@@ -34,9 +34,15 @@ class Yggdrasil():
 			item.created_at = datetime.now()
 			db.session.add(item)
 			db.session.commit()
-
+
 		return item

+	def addJarName(self, data):
+		jar = self.getOrMake(model = Jar, data = data, where = {'name': data})
+		self.jars[jar.id] = jar
+
+		return jar.id
+
 	def addJar(self, data):
 		jar = self.getOrMake(model = Jar, data = data, where = {'name': data['name']})
 		self.jars[jar.id] = jar
@@ -47,7 +53,6 @@ class Yggdrasil():
 		if not jar in self.jars:
 			raise Exception('Tried to add a channel %s in a nonexistant jar %s.' % (data['name'], jar))

-
 		data['jar_id'] = jar
 		channel = self.getOrMake(model = Channel, data = data, where = {'name': data['name'], 'jar_id': jar})
 		self.channels[channel.id] = channel