Skip to content

Instantly share code, notes, and snippets.

@emre
Created June 26, 2010 11:17
Show Gist options
  • Save emre/453976 to your computer and use it in GitHub Desktop.
Save emre/453976 to your computer and use it in GitHub Desktop.
Django icin SVN installer scripti
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from distutils.sysconfig import get_python_lib
class Installer(object):
def __init__(self):
self.__controlUser()
self.site_packages_dir = get_python_lib()
def __controlUser(self):
if os.getenv("USERNAME") != 'root':
raise Exception("i need root access to complete this task.")
def __checkDir(self, directory):
if os.path.isdir(directory) == False:
try:
os.mkdir(directory)
except:
raise Exception("enter a valid path.")
def __createSymbolikLinks(self, path):
os.system("ln -s %s/django-trunk/django %s/django" % (path, self.site_packages_dir))
os.system("ln -s %s/django-trunk/django/bin/django-admin.py /usr/local/bin" % path)
def install(self):
path = raw_input('enter install path for SVN checkout:')
os.system("svn checkout http://code.djangoproject.com/svn/django/trunk/ %s/django-trunk" % path)
self.__createSymbolikLinks(path)
if __name__ == '__main__':
installer = Installer()
installer.install()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment