From ff2666c5186528288565576b9848432e6a32437c Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 22 Jan 2022 10:24:39 -0800 Subject: [PATCH] Remove codetemplates/ and remove ZSH makers module -- I haven't used either in years --- codetemplates/django/basic/.env | 3 - codetemplates/django/basic/.gitignore | 7 -- codetemplates/django/basic/Makefile | 18 --- codetemplates/django/basic/Procfile | 1 - codetemplates/django/basic/manage.py | 8 -- .../django/basic/project_name/__init__.py | 0 .../django/basic/project_name/models.py | 3 - .../django/basic/project_name/tests.py | 16 --- .../django/basic/project_name/views.py | 1 - codetemplates/django/basic/requirements.txt | 4 - codetemplates/django/basic/settings.py | 111 ------------------ codetemplates/django/basic/urls.py | 16 --- zsh/func/makers/mkcodemod | 73 ------------ zsh/func/makers/mkdjango | 58 --------- zsh/func/makers/mkmdir | 18 --- 15 files changed, 337 deletions(-) delete mode 100644 codetemplates/django/basic/.env delete mode 100644 codetemplates/django/basic/.gitignore delete mode 100644 codetemplates/django/basic/Makefile delete mode 100644 codetemplates/django/basic/Procfile delete mode 100644 codetemplates/django/basic/manage.py delete mode 100644 codetemplates/django/basic/project_name/__init__.py delete mode 100644 codetemplates/django/basic/project_name/models.py delete mode 100644 codetemplates/django/basic/project_name/tests.py delete mode 100644 codetemplates/django/basic/project_name/views.py delete mode 100644 codetemplates/django/basic/requirements.txt delete mode 100644 codetemplates/django/basic/settings.py delete mode 100644 codetemplates/django/basic/urls.py delete mode 100644 zsh/func/makers/mkcodemod delete mode 100644 zsh/func/makers/mkdjango delete mode 100644 zsh/func/makers/mkmdir diff --git a/codetemplates/django/basic/.env b/codetemplates/django/basic/.env deleted file mode 100644 index d712735..0000000 --- a/codetemplates/django/basic/.env +++ /dev/null @@ -1,3 +0,0 @@ -DATABASE_URL=sqlite://localhost/local.db -SECRET_KEY={{ secret_key }} -DEBUG=True diff --git a/codetemplates/django/basic/.gitignore b/codetemplates/django/basic/.gitignore deleted file mode 100644 index cbe218d..0000000 --- a/codetemplates/django/basic/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -*.log -*.pot -*.pyc -local_settings.py - -env/ -local.db diff --git a/codetemplates/django/basic/Makefile b/codetemplates/django/basic/Makefile deleted file mode 100644 index ccb845b..0000000 --- a/codetemplates/django/basic/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -MANAGEPY=honcho run -- env/bin/python manage.py - -update: - virtualenv env - env/bin/pip install -r requirements.txt - $(MANAGEPY) syncdb - -migrate: - $(MANAGEPY) migrate - -run: update - $(MANAGEPY) runserver 0.0.0.0:8000 - -shell: update - $(MANAGEPY) shell - -deploy: - git push heroku master diff --git a/codetemplates/django/basic/Procfile b/codetemplates/django/basic/Procfile deleted file mode 100644 index 62c5af6..0000000 --- a/codetemplates/django/basic/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: python manage.py run_gunicorn -w4 -b 0.0.0.0:$PORT diff --git a/codetemplates/django/basic/manage.py b/codetemplates/django/basic/manage.py deleted file mode 100644 index 87ab2e2..0000000 --- a/codetemplates/django/basic/manage.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") - from django.core.management import execute_from_command_line - execute_from_command_line(sys.argv) diff --git a/codetemplates/django/basic/project_name/__init__.py b/codetemplates/django/basic/project_name/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/codetemplates/django/basic/project_name/models.py b/codetemplates/django/basic/project_name/models.py deleted file mode 100644 index 71a8362..0000000 --- a/codetemplates/django/basic/project_name/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/codetemplates/django/basic/project_name/tests.py b/codetemplates/django/basic/project_name/tests.py deleted file mode 100644 index 501deb7..0000000 --- a/codetemplates/django/basic/project_name/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -This file demonstrates writing tests using the unittest module. These will pass -when you run "manage.py test". - -Replace this with more appropriate tests for your application. -""" - -from django.test import TestCase - - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.assertEqual(1 + 1, 2) diff --git a/codetemplates/django/basic/project_name/views.py b/codetemplates/django/basic/project_name/views.py deleted file mode 100644 index 60f00ef..0000000 --- a/codetemplates/django/basic/project_name/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/codetemplates/django/basic/requirements.txt b/codetemplates/django/basic/requirements.txt deleted file mode 100644 index 021ee2f..0000000 --- a/codetemplates/django/basic/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -Django==1.4.1 -virtualenv==1.7.2 -pytz==2012h -dj-database-url==0.2.1 diff --git a/codetemplates/django/basic/settings.py b/codetemplates/django/basic/settings.py deleted file mode 100644 index e27ea14..0000000 --- a/codetemplates/django/basic/settings.py +++ /dev/null @@ -1,111 +0,0 @@ -# Settings for {{ project_name }}. - -import os - -PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) - -DEBUG = os.environ.get('DEBUG', False) -TEMPLATE_DEBUG = DEBUG - -ADMINS = () -MANAGERS = ADMINS - -import dj_database_url -DATABASES = {'default': dj_database_url.config()} - -SITE_ID = 1 - -LANGUAGE_CODE = 'en-us' -USE_I18N = True -USE_L10N = True - -USE_TZ = True -TIME_ZONE = 'America/Los_Angeles' - -MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media') -MEDIA_URL = '/media/' - -STATIC_ROOT = os.path.join(PROJECT_DIR, 'collected-static') -STATIC_URL = '/static/' - -STATICFILES_DIRS = ( - os.path.join(PROJECT_DIR, 'static'), -) - -STATICFILES_FINDERS = ( - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', -) - -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', -) - -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', -) - -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.contrib.auth.context_processors.auth', - 'django.core.context_processors.i18n', - 'django.core.context_processors.request', - 'django.core.context_processors.media', - 'django.core.context_processors.static', - 'django.contrib.messages.context_processors.messages', -) - -ROOT_URLCONF = 'urls' - -TEMPLATE_DIRS = ( - os.path.join(PROJECT_DIR, 'templates'), -) - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.messages', - 'django.contrib.staticfiles', - # Custom apps below here. - '{{ project_name }}', -) - -if DEBUG: - INSTALLED_APPS += ('django.contrib.admin',) - -LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'handlers': { - 'console': { - 'level': 'DEBUG' if DEBUG else 'INFO', - 'class': 'logging.StreamHandler', - }, - }, - 'loggers': { - '': { - 'handlers': ['console'], - 'level': 'INFO', - 'propagate': True, - }, - '{{ project_name }}': { - 'handlers': ['console'], - 'level': 'DEBUG' if DEBUG else 'INFO', - 'propagate': True, - }, - } -} - - -# -# Environment -# - -assert 'SECRET_KEY' in os.environ, 'Set SECRET_KEY in your .env file!' -SECRET_KEY = os.environ['SECRET_KEY'] diff --git a/codetemplates/django/basic/urls.py b/codetemplates/django/basic/urls.py deleted file mode 100644 index c3e6912..0000000 --- a/codetemplates/django/basic/urls.py +++ /dev/null @@ -1,16 +0,0 @@ -from django.conf import settings -from django.conf.urls import patterns, include, url - - -urlpatterns = patterns('', - url(r'', include('{{ project_name }}.urls')), -) - - -if settings.DEBUG: - from django.contrib import admin - admin.autodiscover() - urlpatterns += patterns('', - url(r'^admin/', include(admin.site.urls)), - ) - diff --git a/zsh/func/makers/mkcodemod b/zsh/func/makers/mkcodemod deleted file mode 100644 index d2df6af..0000000 --- a/zsh/func/makers/mkcodemod +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/zsh -# Create a code module -# Eryn Wells - -local opts='Ccmph' -local funcname=$0 - -_usage() { - print_info "Usage: $funcname [-$opts] mod_name [mod_name] ..." 1>&2 -} - -if [[ ${#@} -lt 2 ]]; then - print_error "Insufficient number of arguments" 1>&2 - _usage - return -1 -fi - -local opt -local complete=0 -local srcext='' -local headext='' -local modtype='' - -while getopts $opts opt; do - [[ $complete -eq 1 ]] && return 2 - case $opt in - C) - modtype='C++' - srcext='cc' - headext='hh' - ;; - c) - modtype='C' - srcext='c' - headext='h' - ;; - m) - modtype='Objective-C' - srcext='m' - headext='h' - ;; - p) - modtype='Python' - srcext='py' - ;; - h) - _usage - return 0 - ;; - *) - print_error "Invalid argument: $opt" 1>&2 - _usage - return 1 - ;; - esac - complete=1 -done - -if [[ -z $opt ]]; then - _usage - return -1 -fi - -print_info "Creating $modtype modules" -for mod in $@[$OPTIND,${#@}]; do - print_info_sub $mod - [[ -n $srcext ]] && touch $mod.$srcext - [[ -n $headext ]] && touch $mod.$headext -done - -unfunction _usage -return 0 - diff --git a/zsh/func/makers/mkdjango b/zsh/func/makers/mkdjango deleted file mode 100644 index cf20b7f..0000000 --- a/zsh/func/makers/mkdjango +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/zsh -# Create a Django project using a template in .dotfiles/codetemplates/django -# Eryn Wells - - -function usage_mkdjango -{ - cat <&2 - usage_mkdjango $0 - return -1 - fi - - local tname=$1 - local tdir="$HOME/.codetemplates/django/$tname" - local pname=$2 - local dest=$3 - - if [[ ! -d "$tdir" ]]; then - print_error "Invalid template name: $tname" 1>&2 - return -2 - fi - - print_info "Making Django project '$pname' with template '$tname'" - if [[ -n "$dest" && ! -d "$dest" ]]; then - print_info_sub "Destination directory given but does not exist; creating $dest" - mkdir -p "$dest" - fi - - # Determine what files might not be rendered by django-admin.py - local names=() - for f in `ls -A "$tdir"`; do - # Pick up dotfiles - if [[ -e "$f" && "$f" =~ "^\." ]]; then - names+=("$f") - fi - done - - print_info_sub "Calling django-admin.py" - django-admin.py startproject --template="$tdir" --name=${(j.,.)names} "$pname" "$dest" - exitcode=$? - - return $exitcode -} - -mkdjango $@ diff --git a/zsh/func/makers/mkmdir b/zsh/func/makers/mkmdir deleted file mode 100644 index 298caeb..0000000 --- a/zsh/func/makers/mkmdir +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/zsh -# Make a Maildir directory -# Eryn Wells - -function mkmdir -{ - if [[ $#@ -lt 1 ]]; then - echo "Usage: $0 [maildir ...]" - exit 1 - fi - - for d in $@; do - print_info "Making maildir: $d" - mkdir -p "$d"/{new,cur,tmp} - done -} - -mkmdir "$@"