Skip to content

Instantly share code, notes, and snippets.

View m3ck0's full-sized avatar

Giorgi Jambazishvili m3ck0

  • Tbilisi, Georgia
View GitHub Profile
@m3ck0
m3ck0 / file_matcher.py
Last active March 15, 2021 05:17
utility function to recursively detect file names by pattern
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__'])
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
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")),
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:
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'),
#imports
import os
import shutil
from tkinter import *
from fnmatch import fnmatch
from datetime import datetime
from threading import Thread
#global variables
takeoutPaths = []