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 struct import unpack | |
import Image | |
tag_types = { 0 : 'End', | |
1 : 'Byte', | |
2 : 'Short', | |
3 : 'Int', | |
4 : 'Long', | |
5 : 'Float', | |
6 : 'Double', |
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 -*- | |
''' | |
Новая версия демона, отрефакторенная | |
class Command(BaseDaemon): | |
def start_server(self, options): | |
<some action> | |
или |
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 os | |
from django import template | |
from django.utils.safestring import mark_safe | |
register = template.Library() | |
ICON_PATH = [os.path.join('icons', 'led-icons'), os.path.join('icons', 'clever_icons') ] | |
ALIASES = { | |
'add':'add-icon', | |
'edit':'pencil', |
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 -*- | |
from django.db import models | |
import zlib | |
try: | |
import cPickle as pickle | |
except ImportError: | |
import pickle | |
from south.modelsinspector import add_introspection_rules | |
add_introspection_rules([], ["^b2b\.fields\.PickledObjectField"]) |
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 -*- | |
import os | |
import Image | |
from django.core.files.storage import FileSystemStorage | |
from django.db import models | |
from django.db.models.fields.files import ImageFieldFile | |
from south.modelsinspector import add_introspection_rules | |
add_introspection_rules([], ["^blog\.fields\.AvatarImageField"]) |
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 -*- | |
import os | |
import sys | |
import imp | |
from django.template.loader import BaseLoader | |
from django.template.loaders.filesystem import Loader as FileSystemLoader | |
from django.template.base import TemplateDoesNotExist | |
from django.conf import settings |
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.shortcuts import render_to_response | |
from django.template import RequestContext | |
from functools import wraps | |
def render_to(template_name, title='Main'): | |
""" | |
Decorator for Django views that sends returned dict to render_to_response function | |
with given template and RequestContext as context instance. | |
If view doesn't return dict then decorator simply returns output. |
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
#!./virtualenv_python.sh | |
#some text |
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 -*- | |
''' | |
Usage: | |
python album_fetcher.py https://plus.google.com/photos/118353143366443526186/albums/5626152497309725217 | |
python album_fetcher.py https://plus.google.com/118353143366443526186 | |
python album_fetcher.py https://plus.google.com/118353143366443526186 youremail@gmail.com yourpassword | |
python album_fetcher.py https://plus.google.com/118353143366443526186 youremail@gmail.com yourpassword /out_dir/ | |
TODO: use opt parse | |
''' | |
import os |
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 -*- | |
''' | |
http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_python.html | |
''' | |
import os | |
import os.path | |
import mimetypes | |
import sys | |
import logging | |
import logging.handlers |
OlderNewer