Skip to content

Commit

Permalink
Merge pull request #41 from XereoNet/2.1.2
Browse files Browse the repository at this point in the history
2.1.2
  • Loading branch information
Connor Peet committed Sep 17, 2014
2 parents f424781 + 7a3e8ae commit a09f93f
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 22 deletions.
6 changes: 4 additions & 2 deletions loader/resources/cauldron_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def load_pack(self, path, url):
def parse_rows(self, row):
version, minecraft, release, downloads = row.find_all('td')
url = downloads.find_all('a').pop()['href']
build = re.sub(r'[^0-9]', '', version.text)

return {
'$parents': [
Expand All @@ -40,15 +41,16 @@ def parse_rows(self, row):
'$id': minecraft.text,
'resource': 'version',
'version': minecraft.text,
'mc_version': minecraft.text
'mc_version': minecraft.text,
'last_build': build
}
],
'$id': version.text,
'$load': lambda path: self.download(url, path),
'$patched': False,
'resource': 'build',
'created': datetime.datetime.strptime(release.text, '%m/%d/%Y %I:%M:%S %p'),
'build': re.sub(r'[^0-9]', '', version.text),
'build': build,
'url': url,
}

Expand Down
3 changes: 2 additions & 1 deletion loader/resources/craftbukkit_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def parse_results(self, result):
'$id': result['version'],
'resource': 'version',
'version': result['version'],
'mc_version': re.search(r'^[0-9\.]+', result['version']).group(0)
'mc_version': re.search(r'^[0-9\.]+', result['version']).group(0),
'last_build': result['build_number']
}
],
'$id': str(result['build_number']),
Expand Down
6 changes: 4 additions & 2 deletions loader/resources/creeperrepo_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def parse_pack(self, elem):

url = (self.base_url + urllib.parse.quote_plus('modpacks^{dir}^{version}'.format(**urlparts))
+ '/' + elem['url'])
build = re.sub(r'[^0-9]', '', elem['version'])

return {
'$parents': [
Expand All @@ -60,15 +61,16 @@ def parse_pack(self, elem):
'$id': elem['version'],
'resource': 'version',
'version': elem['version'],
'mc_version': elem['mcVersion']
'mc_version': elem['mcVersion'],
'last_build': build
}
],
'$id': elem['version'],
'$load': lambda path: self.load_pack(elem, url, path),
'$patched': True,
'resource': 'build',
'created': datetime.datetime.now(),
'build': re.sub(r'[^0-9]', '', elem['version']),
'build': build,
'url': url,
}

Expand Down
14 changes: 8 additions & 6 deletions loader/resources/directs/pixelmon.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"description": ""
},
{
"$id": "3.2.4",
"resource": "version",
"version": "3.2.4"
"$id": "3.2.4",
"resource": "version",
"version": "3.2.4",
"last_build": 324
}
],
"$id": "1710",
Expand All @@ -40,9 +41,10 @@
"description": ""
},
{
"$id": "3.1.4",
"resource": "version",
"version": "3.1.4"
"$id": "3.1.4",
"resource": "version",
"version": "3.1.4",
"last_build": 314
}
],
"$id": "17",
Expand Down
7 changes: 5 additions & 2 deletions loader/resources/mojang_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def parse_version(self, version):
url = self.download_url_base.format(version['id'])
released = datetime.datetime.strptime(re.sub(r'\+[0-9]{2}:[0-9]{2}$', '',
version['releaseTime']), '%Y-%m-%dT%H:%M:%S')
build = math.floor(released.timestamp() / 100)

return {
'$parents': [
{
Expand All @@ -55,15 +57,16 @@ def parse_version(self, version):
}, {
'$id': version['id'],
'resource': 'version',
'version': version['id']
'version': version['id'],
'last_build': build,
}
],
'$id': version['id'],
'$load': lambda path: self.download(url, path),
'$patched': False,
'resource': 'build',
'created': released,
'build': math.floor(released.timestamp() / 100),
'build': build,
'url': url,
}

Expand Down
31 changes: 23 additions & 8 deletions loader/resources/technic_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,23 @@ class Technic():

listing_url = 'http://solder.technicpack.net/api/modpack'
pack_url = 'http://solder.technicpack.net/api/modpack/%s'
download_url = 'http://mirror.technicpack.net/Technic/servers/{name}/{cap_name}_Server_v{build}.zip'
download_url = 'http://mirror.technicpack.net/Technic/servers/'

descriptions = {
'release': 'An official release of a Minecraft version.',
'snapshot': 'The latest testing snapshot of Minecraft. It may be unstable!'
}

mapping = {
'attack-of-the-bteam': 'bteam/BTeam_Server_v',
'tekkitmain': 'tekkitmain/Tekkit_Server_v',
'tekkit': 'tekkit/Tekkit_Server_',
'bigdig': 'bigdig/BigDigServer-v',
'hexxit': 'hexxit/Hexxit_Server_v',
'voltz': 'voltz/Voltz_Server_v',
'tekkitlite': 'tekkitlite/Tekkit_Lite_Server_'
}

def __init__(self):
pass

Expand All @@ -42,11 +52,15 @@ def get_versions(self, slug):

out = []
for build in data['builds']:
url = self.download_url.format(**{
'name': data['name'],
'cap_name': data['name'].capitalize(),
'build': build
})
if data['name'] in self.mapping:
name = self.mapping[data['name']]
else:
continue

url = self.download_url + name + build + '.zip'

print(url)
build_num = re.sub(r'[^0-9]', '', build)

out.append({
'$parents': [
Expand All @@ -63,15 +77,16 @@ def get_versions(self, slug):
}, {
'$id': build,
'resource': 'version',
'version': build
'version': build,
'last_build': build_num
}
],
'$id': build,
'$load': lambda path, url=url, slug=slug: self.load_pack(url, path, slug),
'$patched': True,
'resource': 'build',
'created': datetime.datetime.now(),
'build': re.sub(r'[^0-9]', '', build),
'build': build_num,
'url': url,
})

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='SpaceGDN',
version='2.1.1',
version='2.1.2',
url='https://github.com/connor4312/querytree',
author='Connor Peet',
author_email='[email protected]',
Expand Down

0 comments on commit a09f93f

Please sign in to comment.