From 97abd839749861158187f80079a2100e85499e34 Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 26 Sep 2012 03:36:37 +0530 Subject: [PATCH] upgrade ox --- COPYING | 14 ++++++++++++++ requirements.txt | 4 +--- rizk/egypt/models.py | 12 ++++++------ 3 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 COPYING diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..c97633a --- /dev/null +++ b/COPYING @@ -0,0 +1,14 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2010 Sanjay Bhangar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/requirements.txt b/requirements.txt index dc210a0..f5e987e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,5 @@ -e svn+http://code.djangoproject.com/svn/django/branches/releases/1.2.X/#egg=django --e bzr+http://code.0xdb.org/python-oxdjango/#egg=python-oxdjango --e bzr+http://code.0xdb.org/python-oxlib/#egg=python-oxlib --e bzr+http://code.0xdb.org/python-oxweb/#egg=python-oxweb +ox South elementtree django-extensions diff --git a/rizk/egypt/models.py b/rizk/egypt/models.py index 57780ce..001687f 100644 --- a/rizk/egypt/models.py +++ b/rizk/egypt/models.py @@ -1,12 +1,12 @@ from django.contrib.gis.db import models -import oxlib +import ox import flickr import settings try: import json except: import simplejson as json -from oxweb import youtube +from ox.web import youtube flickr.API_KEY = settings.FLICKR_API_KEY flickr.SECRET = settings.FLICKR_SECRET @@ -56,12 +56,12 @@ class Image(models.Model): #this function is fucked. either just get user to enter flickr id, or write a recursive function with an array of regexps and pray. but this is just crap. def get_flickr_id(self): regex = r'http\:\/\/.*?\/\d{4}/(.*?)_.*' - id = oxlib.findRe(self.url, regex) + id = ox.find_re(self.url, regex) if id != '': return id else: regex = r'http://.*?/.*?/.*?/(.*?)/in/.*' - return oxlib.findRe(self.url, regex) + return ox.find_re(self.url, regex) def __unicode__(self): return self.url + " - " + self.caption @@ -159,10 +159,10 @@ class YoutubeVideo(models.Model): def get_youtube_id(self): reg = r'http.*?v=(.*?)$' - id = oxlib.findRe(self.url, reg) + id = ox.find_re(self.url, reg) if id == '': reg = r'http://.*?/user/.*?/u/.*?/(.*?)$' - id = oxlib.findRe(self.url, reg) + id = ox.find_re(self.url, reg) return id def get_dict(self):