This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from typing import List | |
from pathlib import Path | |
def match_files(root: Path, pattern, exclude_items: List[str]) -> List[Path]: | |
""" | |
utility function to recursively detect file names by pattern. | |
>>> match_files(Path.cwd(), re.compile('.*?\.py'), ['__pycache__']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
from django.http import JsonResponse | |
from django.http import HttpResponseRedirect | |
from django.core.urlresolvers import reverse | |
from django.shortcuts import render | |
from django.shortcuts import render_to_response | |
from django.shortcuts import redirect | |
from django.views.generic import View | |
from django.views.generic import TemplateView | |
from django.views.generic import RedirectView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from django.utils.translation import ugettext_lazy as _ | |
from .models import Account | |
class AccountForm(forms.ModelForm): | |
SEX_CHOICE = ( | |
("U", _("Unspecified")), | |
("M", _("Male")), | |
("F", _("Female")), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.models import AbstractBaseUser | |
from django.contrib.auth.models import BaseUserManager | |
from django.utils.translation import ugettext_lazy as _ | |
from django.db import models | |
# Create your models here. | |
class AccountManager(BaseUserManager): | |
def create_user(self, email, password=None, **kwargs): | |
if not email: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.decorators import login_required | |
from django.conf.urls import url | |
from .views import HomeView | |
from .views import SigninView | |
from .views import SignupView | |
from .views import SignoutView | |
urlpatterns = [ | |
url('^$', login_required(HomeView.as_view()), name='index'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#imports | |
import os | |
import shutil | |
from tkinter import * | |
from fnmatch import fnmatch | |
from datetime import datetime | |
from threading import Thread | |
#global variables | |
takeoutPaths = [] |