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
# -*- coding: UTF-8 -*- | |
#! usr/bin/python3 | |
__author__ = "Jani Šumak <[email protected]>" | |
__version__ = "1.0" | |
import datetime | |
import logging | |
import json | |
import time |
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
#!/usr/bin/env python | |
from io import TextIOWrapper | |
import csv | |
from flask import Flask, request, redirect, url_for | |
from flask_sqlalchemy import SQLAlchemy | |
# Create Flaskk app, config the db and load the db object | |
# http://flask-sqlalchemy.pocoo.org/2.1/quickstart/#a-minimal-application |
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
# Save an image from the shell or programatically to Wagtail | |
# If you are using a cutom Image model, please import your model | |
import os | |
from django.core.file import File | |
from wagtail.wagtailimages.models import Image | |
def save_image_to_wagtail(image): | |
""" |
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
def get_urls(css_file): | |
""" | |
Get all URLs from a CSS file with regex pattern matching. | |
URI's, like data URIs are ignored and URLs might be relative. | |
:param css_file: a string representing the CSS file (use open() | |
and read() or a request library to get the string) | |
:return: list with retrived urls | |
""" |
NewerOlder