From 862787a16df216a4601e90acc170a0c962da3c12 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Tue, 9 Feb 2010 13:57:31 +0100 Subject: [PATCH] remove getSlice management command --- pyweb/mumble/management/commands/getslice.py | 65 -------------------- 1 file changed, 65 deletions(-) delete mode 100644 pyweb/mumble/management/commands/getslice.py diff --git a/pyweb/mumble/management/commands/getslice.py b/pyweb/mumble/management/commands/getslice.py deleted file mode 100644 index f1d9bd7..0000000 --- a/pyweb/mumble/management/commands/getslice.py +++ /dev/null @@ -1,65 +0,0 @@ -# -*- coding: utf-8 -*- - -""" - * Copyright © 2009-2010, Michael "Svedrin" Ziegler - * - * Mumble-Django is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. -""" - -import re - -from os import listdir -from os.path import join - -from urllib import urlopen - -from django.core.management.base import BaseCommand -from django.conf import settings - - -HEAD_SLICE_URL = 'http://mumble.git.sourceforge.net/git/gitweb.cgi?p=mumble/mumble;a=blob_plain;f=src/murmur/Murmur.ice;hb=HEAD' - - -class Command( BaseCommand ): - def handle(self, **options): - nameregex = re.compile( "Murmur_(\d)-(\d)-(\d).ice" ) - basepath = join( settings.MUMBLE_DJANGO_ROOT, 'pyweb', 'mumble' ) - version = [0, 0, 0] - - for filename in listdir( basepath ): - match = nameregex.match( filename ) - if match: - for idx in range(3): - namedigit = int( match.group(idx + 1) ) - if version[idx] < namedigit: - version = [ - int( match.group(1) ), - int( match.group(2) ), - int( match.group(3) ), - ] - break - - version[2] += 1 - - userversion = raw_input( "Enter current HEAD version [%d.%d.%d]: " % tuple(version) ) - if userversion: - version = [ int(digit) for digit in userversion.split('.') ] - - slicefile = join( settings.MUMBLE_DJANGO_ROOT, 'pyweb', 'mumble', 'Murmur_%d-%d-%d.ice' % tuple(version) ) - - gitfile = urlopen( HEAD_SLICE_URL ).fp.read(); - - slicefd = open( slicefile, 'wb' ); - slicefd.write( gitfile ); - slicefd.close(); - - -