code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | Python |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
'''
Revisionist: a module to get the latest source code revision for a Django project,
for use as a static content versioning device. Currently supports Mercurial,
Subversion and Bazaar.
http://www.fairviewcomputing.com/blog/2008/03/03/automatic-django-static-content-versioning/
Copyright (c) 2008 Fairview Computing... | Python |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Benjamin Heil
#
# This file is part of Feedmail.
#
# Feedmail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | Python |
#!/usr/bin/env python
# CheckMentioned.py
# Find all the properties used in SciTE source files and check if they
# are mentioned in scite/doc/SciTEDoc.html.
import os
import string
import stat
srcRoot = "../../scite"
srcDir = os.path.join(srcRoot, "src")
docFileName = os.path.join(srcRoot, "doc", "SciTEDoc... | Python |
#!/usr/bin/env python
# RegenerateSource.py - implemented 2013 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Regenerate the SciTE source files that list all the lexers and all the
# properties files.
# Should be run whenever a new lexer is added or removed.
# Requires Python 2.5 or late... | Python |
#!/usr/bin/env python3
# CheckMentioned.py
# Find all the symbols in scintilla/include/Scintilla.h and check if they
# are mentioned in scintilla/doc/ScintillaDoc.html.
import string
uninteresting = {
"SCINTILLA_H", "SCI_START", "SCI_LEXER_START", "SCI_OPTIONAL_START",
# These archaic names are #defined to... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import os, sys
scintillaDirectory = os.path.join("..", "..", "scintilla")
scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")
sys.path.append(scintillaScriptsDirectory)
import Face
def cell(s):
retu... | Python |
#!/usr/bin/env python
# makerpms.py
# Copy files all over the place build RPMs and copy to top level directory
import os
import shutil
srcRoot = "../../"
rpmRoot = "/usr/src/redhat/SOURCES/"
rpmBin = "/usr/src/redhat/RPMS/i386/"
rpmSource = "/usr/src/redhat/SRPMS/"
verFileName = srcRoot + "scintilla/versio... | Python |
#! /usr/bin/env python
# Produces a .api file for SciTE's identifier completion and calltip features.
# invoke as
# python tags2api.py tags >x.api
# before running this program, create a tags file with
# ctags --excmd=number --c-types=pcdgstu <header files>
import fileinput
import time
# Definitions tha... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from PySide.QtCore import *
from PySide.QtGui import *
import ScintillaConstants as sci
sys.path.append("../..")
from bin import ScintillaEditPy
txtInit = "int main(int argc, char **argv) {\n" \
" // Start up the gnome\n" \
" gnome_init(... | Python |
import distutils.sysconfig
import getopt
import glob
import os
import platform
import shutil
import subprocess
import stat
import sys
sys.path.append(os.path.join("..", "ScintillaEdit"))
import WidgetGen
scintillaDirectory = "../.."
scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")... | Python |
#!/usr/bin/env python
# WidgetGen.py - regenerate the ScintillaWidgetCpp.cpp and ScintillaWidgetCpp.h files
# Check that API includes all gtkscintilla2 functions
import sys
import os
import getopt
scintillaDirectory = "../.."
scintillaScriptsDirectory = os.path.join(scintillaDirectory, "scripts")
sys.path.a... | Python |
#!/usr/bin/env python
# HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface
# definition file.
# Implemented 2000 by Neil Hodgson neilh@scintilla.org
# Requires Python 2.5 or later
import sys
import os
import Face
from FileGenerator import UpdateFile, Generate, Reg... | Python |
# Script to generate CaseConvert.cxx from Python's Unicode data
# Should be run rarely when a Python with a new version of Unicode data is available.
# Should not be run with old versions of Python.
# Current best approach divides case conversions into two cases:
# simple symmetric and complex.
# Simple symmetr... | Python |
#!/usr/bin/env python
# LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Regenerate the Scintilla source files that list all the lexers.
# Should be run whenever a new lexer is added or removed.
# Requires Python 2.5 or later
# Files are regenerated in place wi... | Python |
# Script to generate CharacterCategory.cxx from Python's Unicode data
# Should be run rarely when a Python with a new version of Unicode data is available.
# Should not be run with old versions of Python.
import codecs, os, platform, sys, unicodedata
from FileGenerator import Regenerate
def findCategories(fi... | Python |
# Face.py - module for reading and parsing Scintilla.iface file
# Implemented 2000 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Requires Python 2.5 or later
def sanitiseLine(line):
if line[-1:] == '\n': line = line[:-1]
if line.find("##") != -1:
line = line[:line.find("##")]
lin... | Python |
# ScintillaData.py - implemented 2013 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Common code used by Scintilla and SciTE for source file regeneration.
# The ScintillaData object exposes information about Scintilla as properties:
# Version properties
# version
# versionDotted
... | Python |
#!/usr/bin/env python
# LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Regenerate the Scintilla and SciTE source files that list
# all the lexers and all the properties files.
# Should be run whenever a new lexer is added or removed.
# Requires Python 2.4 or ... | Python |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import io, os, sys, unittest
if sys.platform == "win32":
import XiteWin as Xite
else:
import XiteQt as Xite
keywordsHTML = [
b"b body content head href html link meta "
b"name rel script strong title type xmlns",
b"function",
b"sub"
]
... | Python |
# List many windows message numbers
msgs = {
"WM_ACTIVATE":6,
"WM_ACTIVATEAPP":28,
"WM_CAPTURECHANGED":533,
"WM_CHAR":258,
"WM_CLOSE":16,
"WM_CREATE":1,
"WM_COMMAND":273,
"WM_DESTROY":2,
"WM_ENTERSIZEMOVE":561,
"WM_ERASEBKGND":20,
"WM_EXITSIZEMOVE":562,
"WM_GETMINMAXINFO":36,
"WM_GETTEXT":13,
"WM_IME_S... | Python |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from __future__ import unicode_literals
import codecs, ctypes, os, sys, unittest
if sys.platform == "win32":
import XiteWin as Xite
else:
import XiteQt as Xite
class TestSimple(unittest.TestCase):
def setUp(self):
self.xite = Xite.xi... | Python |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from __future__ import unicode_literals
import os, sys, unittest
import ctypes
from ctypes import wintypes
from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort, c_uint, c_long
from ctypes.wintypes import HWND, WPARAM, LPARAM, HANDLE,... | Python |
# Convert all punctuation characters except '_', '*', and '.' into spaces.
def depunctuate(s):
'''A docstring'''
"""Docstring 2"""
d = ""
for ch in s:
if ch in 'abcde':
d = d + ch
else:
d = d + " "
return d
| Python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import ctypes, os, sys
from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort, c_uint, c_long
class TEXTRANGE(ctypes.Structure):
_fields_= (\
('cpMin', c_long),
('cpMax', c_long),
('lpstrText', ctypes.POINTER(ctypes.c_char)... | Python |
# -*- coding: utf-8 -*-
from __future__ import with_statement
from __future__ import unicode_literals
import os, string, sys, time, unittest
if sys.platform == "win32":
import XiteWin as Xite
else:
import XiteQt as Xite
class TestPerformance(unittest.TestCase):
def setUp(self):
self.xite = Xite... | Python |
# -*- coding: utf-8 -*-
import ctypes, os, sys, unittest
from PySide.QtCore import *
from PySide.QtGui import *
import ScintillaCallable
sys.path.append("..")
from bin import ScintillaEditPy
scintillaDirectory = ".."
scintillaIncludeDirectory = os.path.join(scintillaDirectory, "include")
scintillaScr... | Python |
# -*- coding: utf-8 -*-
import XiteWin
if __name__ == "__main__":
XiteWin.main("")
| Python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
""" Define the menu structure used by the Pentacle applications """
MenuStructure = [
["&File", [
["&New", "<control>N"],
["&Open...", "<control>O"],
["&Save", "<control>S"],
["Save &As...", "<control><shift>S"],
["Test", ""],
... | Python |
class RewiteLocalForwardedRequest:
def process_request(self, request):
if request.META.has_key('HTTP_X_FORWARDED_HOST'):
request.META['HTTP_HOST'] = request.META['HTTP_X_FORWARDED_HOST']
#request.META['SERVER_NAME'] = request.META['HTTP_X_FORWARDED_HOST']
| Python |
from westom import settings
def default(request):
"""
Returns some default context variables
"""
return {
'MEDIA_URL': settings.MEDIA_URL,
'URL_HOST': settings.URL_HOST,
} | Python |
from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User
from westom.settings import FEEDS_DIR
from westom.feednut.utils import misc as misc_utils
import os
import cPickle as pickle
#Set up File locks in a system-independent manner
try:
from fcntl import l... | Python |
from django.contrib.syndication.feeds import Feed as FEED
from django.contrib.syndication.feeds import ObjectDoesNotExist
from django.contrib.syndication.views import feed as feed_func
from django.views.decorators.cache import cache_page
from westom.feednut.utils import user as user_utils
from westom.feednut.utils... | Python |
from UserDict import DictMixin
class Properties(DictMixin):
""" Takes a java like properties file seperated by new lines and stores it as a dictionary object"""
def __init__(self, prefString):
self.prefString = prefString
self.data = {}
self.data = self.parse()
self.properties ... | Python |
import urllib, re
from westom.feednut.libs import syndic8
from westom.feednut.utils import feed_accomplice
URL_TECHNORATI = 'http://www.technorati.com/pop/blogs/?faves=1'
def scrape_technorati_top100():
""" Returns a list of URLs representing the top 100 blogs """
lines = urllib.urlopen(URL_TECHNORATI).read()... | Python |
import unittest
from properties import Properties
class PropertiesTestCase(unittest.TestCase):
def setup(self):
pass
def teardown(self):
pass
def runTest(self):
"""Test blank"""
prefString= ""
prefs = Properties(prefString)
prefString = "default.name=Bilbo B... | Python |
"""
Feed utility functions
"""
from django.db import connection
from westom.feednut.models import *
from westom.feednut.libs import feedparser
import time
from datetime import datetime
from westom.feednut.utils import misc as misc_utils
from westom.feednut.utils import feed_utils
from westom.settings import U... | Python |
import os, logging
from PyLucene import FSDirectory, IndexReader, IndexModifier, StandardAnalyzer, \
IndexSearcher, Document, Term, Field, Sort, MultiFieldQueryParser, \
QueryParser
from dateutil import parser
import cPickle as pickle
from westom.settings import DOCUMENT_ROOT
... | Python |
from westom.feednut.cache import Cache, ExpiredError
from westom.settings import FEEDS_DIR
import os, cPickle
class FeedCache(Cache):
def get_full_path(self, key):
""" returns the full path to the data file """
return os.path.abspath(os.path.join(FEEDS_DIR, key))
def get_feed_data(se... | Python |
import string, types, datetime
from django.db.models.base import ModelBase
from django.db import models
from westom.feednut.models import *
from westom.feednut.libs import json
from django.db.models.query import QuerySet
class DjangoJsonWriter(json.JsonWriter):
def write(self, obj, escaped_forward_slash=False... | Python |
from HTMLParser import HTMLParser
from westom.feednut.libs.openanything import fetch
MOZILLA_AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4'
class FeedFinder(HTMLParser):
def reset(self):
self.links = []
self.result = None #will be... | Python |
#!/usr/bin/env python
'''
- requires Python 2.4, cElementTree, elementtree, and elementtidy.
- also uses Mark Pilgrim's openanything lib
- uses PyXML
see http://effbot.org/downloads/ to download the element* packages
Example usage:
url = 'http://www.rssgov.com/rssparsers.html'
dom = HtmlDom(url)
print do... | Python |
from westom.feednut.libs.ScrapeNFeed import ScrapedFeed
from westom.feednut.libs.PyRSS2Gen import RSSItem, Guid
class SimpleFeed(ScrapedFeed):
def __init__(self, title, url, description, rssItems,
rssFile=None, pickleFile=None, maxItems=20, **kwargs):
ScrapedFeed.__init__(self,
... | Python |
from string import letters, digits
import re
VALID_CHARS = letters + digits
def clean_string(s):
""" cleans a string, removing any non-letters/digits """
return ''.join([c in VALID_CHARS and c or '_' for c in s])
class Singleton(type):
def __init__(cls,name,bases,dic):
super(Singleton,... | Python |
"""
Searchp utility functions
"""
from westom.feednut.models import *
from westom.feednut.libs import feedparser
import time
from datetime import datetime
from westom.feednut.utils import misc as misc_utils
from westom.feednut.libs import yahoo_terms
from westom.feednut.libs.BeautifulSoup import BeautifulSoup
... | Python |
# -*- coding: utf-8 -*-
from django.db.models.base import ModelBase
from django.db import models
import types
def _filter_bases(bases, filter_key):
""" Remove all classes descendants of ``filter_key`` from ``bases`` """
new_bases = tuple([base for base in bases \
if ((not (base is filte... | Python |
import sys, os, re, logging, time, shutil, threading
import cPickle as pickle
from string import letters, digits
from datetime import datetime
from dateutil import parser
import PyLucene as lucene
from django.db.models import Q
from westom.feednut.libs import feedparser
from westom.feednut.libs import uuid
from westom... | Python |
import time, random, md5, socket
def uuid(*args):
"""
Generates a 32-character universally unique ID.
This does not follow the UUID spec.
Any arguments only create more randomness.
"""
t = long(time.time() * 1000)
r = long(random.random()*100000000000000000L)
try:
a = socket.get... | Python |
#!/usr/bin/env python
'''
- requires Python 2.4, cElementTree, elementtree, and elementtidy.
- also uses Mark Pilgrim's openanything lib
- uses PyXML
see http://effbot.org/downloads/ to download the element* packages
Example usage:
url = 'http://www.rssgov.com/rssparsers.html'
dom = HtmlDom(url)
print do... | Python |
from westom.feednut.utils import feed_accomplice
import time, threading
class Task(threading.Thread):
"""
A Scheduler Task
"""
def __init__(self, action, loopdelay, initdelay):
self._action = action
self._loopdelay = loopdelay
self._initdelay = initdelay
self._running =... | Python |
from westom.feednut.models import *
from django.db.models import Q
from westom.feednut.libs.pybloglines import pybloglines
from westom.feednut.libs.pyblogger import blogger
import re
def get_user_blogs(user, type=None):
"""
This returns a list of tuples (size 2).
Each tuple consists of the... | Python |
from django.template import Library, Node
from django import template
from westom.feednut.utils import user as user_utils
from westom.feednut.utils import misc as misc_utils
from westom.feednut.utils import feed_accomplice
from westom.feednut.models import *
register = Library()
def get_entries(parser, tok... | Python |
from django.template import Library
from westom.feednut.utils import misc as misc_utils
import re
register = Library()
def split_seq(list, num):
"""
Splits the given list into the given number of lists
Argument: optional, number of lists to return (default=2)
"""
return misc_utils.split... | Python |
from django import template
from westom.settings import SITE_ID
import Captcha
from Captcha.Visual import Tests
import tempfile
def _getFactory(id):
return Captcha.PersistentFactory(tempfile.gettempdir() + "/pycaptcha_%d" % id )
class captcha_class(template.Node):
""" generate a captcha image and sp... | Python |
from westom.feednut.models import *
from westom.feednut.libs import OPMLSubscription as opml
from westom.feednut.utils import feed_accomplice
from westom.feednut.utils import user as user_utils
from westom.feednut.utils.lucene_utils import FeedSearcher
from westom.feednut.utils import djangojson
from westom.feedn... | Python |
from django.core.exceptions import ObjectDoesNotExist, ViewDoesNotExist
from westom.settings import SITE_ID
from django.core import urlresolvers
from django.http import Http404, HttpResponse, HttpResponseRedirect
from Captcha.Visual import Tests
import Captcha
import tempfile
def _getFactory( id ):
return Captcha... | Python |
from django.core.mail import send_mail
def send_welcome_email(user):
""" sends an email to the user welcoming them to FeedNut """
subject = 'Welcome to FeedNut'
message = """Thanks for signing up for a free account at www.feednut.com!
Now you can quickly organize and read the news YOU want to read b... | Python |
#!/usr/bin/env python
"""Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit http://feedparser.org/ for the latest version
Visit http://feedparser.org/docs/ for the latest documentation
Required: Python 2.1 or later
Recommended: Python 2.3 or later
Recommended:... | Python |
"""PyRSS2Gen - A Python library for generating RSS 2.0 feeds."""
__name__ = "PyRSS2Gen"
__version__ = (1, 0, 0)
__author__ = "Andrew Dalke <dalke@dalkescientific.com>"
_generator_name = __name__ + "-" + ".".join(map(str, __version__))
import datetime
# Could make this the base class; will need to add 'pub... | Python |
r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() ... | Python |
"""Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-structur... | Python |
"""Text to Scripting News XML
This module converts loosely structured text into XML that conforms to
the Scripting News XML format.
About the Scripting News XML format:
http://my.userland.com/stories/storyReader$11
Specification for text to XML translation:
http://my.userland.com/stories/storyReader$14
... | Python |
"""Extensions to the Blogger XML-RPC interface
This module implements some useful functions which ought
to be part of Blogger's XML-RPC interface, but aren't.
These functions are Blogger.com-specific and do not use
XML-RPC, so they will not work with weblog servers that
are otherwise compatible with the Blogger ... | Python |
#!/usr/bin/env python
"""
post to, repost to, or delete articles from a weblog via Blogger API
requires pyblogger and xmlrpclib
Copyright 2001 Adam Feuer
This is free software, distributed under the Python 2.1.1 license.
See http://www.python.org/2.1.1/license.html
---------------------------
reads ... | Python |
#!/usr/bin/env python
"""
post to, repost to, or delete articles from a weblog via Blogger API
requires pyblogger and xmlrpclib
Copyright 2001 Adam Feuer
This is free software, distributed under the Python 2.1.1 license.
See http://www.python.org/2.1.1/license.html
---------------------------
reads ... | Python |
"""Factory to output blogs in various formats
Currently supported formats:
- RSS: for syndication
- Scripting News XML: also for syndication
- minimal HTML: for text browsers and mobile devices
- Javascript: for dynamic inclusion in other HTML pages
"""
__author__ = "Mark Pilgrim (f8dy@diveintomark.org)"
__... | Python |
"""Unit tests for blogger.py
These require PyUnit (unittest.py), which is part of the standard library
starting with Python 2.1.
"""
__author__ = "Mark Pilgrim (f8dy@diveintomark.org)"
__version__ = "$Revision: 1.1 $"
__date__ = "$Date: 2006/03/04 10:07:32 $"
__copyright__ = "Copyright (c) 2001 Mark Pilgrim"... | Python |
"""
postObject model for Blogger
This is a high-level object-oriented interface for blogger.py,
which defines all the available functions exposed by Blogger.com's
XML-RPC API.
This code was originally written by Mark Pilgrim
(f8dy@diveintomark.org). I have added objects to allow interface with the added
m... | Python |
"""Blogger interface for Python
http://sourceforge.net/projects/pyblogger/
This module allows you to post to a weblog and manipulate its
settings. It was originally designed to work with Blogger
(http://www.blogger.com/), but other weblog systems have since
implemented this API, and this module can talk to an... | Python |
# PyBloglines $Id: pybloglines.py,v 1.2 2006/03/04 10:10:47 tzellman Exp $
# Module for accessing the Bloglines Web Services
# See <http://www.josephson.org/projects/pybloglines/>
# Suggestion to add BloglinesUnread to OPML parsing by Erik Bryn
import urllib
import urllib2
import string
import re
import bas... | Python |
import string
import types
import decimal
## json.py implements a JSON (http://json.org) reader and writer.
## Copyright (C) 2005 Patrick D. Logan
## Contact mailto:patrickdlogan@stardecisions.com
##
## This library is free software; you can redistribute it and/or
## modify it under the terms ... | Python |
'''OpenAnything: a kind and thoughtful library for HTTP web services
This program is part of 'Dive Into Python', a free Python book for
experienced programmers. Visit http://diveintopython.org/ for the
latest version.
'''
__author__ = 'Mark Pilgrim (mark@diveintopython.org)'
__version__ = '$Revision: 1.6 $'[11:-2]
_... | Python |
## Copyright (c) 1999 - 2003 L. C. Rees. All rights reserved.
## See COPYRIGHT file for license terms.
## http://www.theotherblog.com/Articles/2006/08/04/python-web-crawler-spider/
from __future__ import generators
from traceback import *
__name__ = 'spider'
__version__ = '0.5'
__author__ = 'L.C. Rees (xanimal@user... | Python |
#!/usr/bin/env python
#
# libgmail -- Gmail access via Python
#
## To get the version number of the available libgmail version.
## Reminder: add date before next release. This attribute is also
## used in the setup script.
Version = '0.1.4' # (Feb 2006)
# Original author: follower@myrealbox.com
# Maintainers... | Python |
#!/usr/bin/env python
#
# libgmail -- Gmail access via Python
#
## To get the version number of the available libgmail version.
## Reminder: add date before next release. This attribute is also
## used in the setup script.
Version = '0.1.4' # (Feb 2006)
# Original author: follower@myrealbox.com
# Maintainers... | Python |
NAME = 'Technorati/Python'
VERSION = '0.05'
# Copyright (C) 2003 Phillip Pearson
URL = 'http://www.myelin.co.nz/technorati_py/'
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without rest... | Python |
# simpletest
print "Testing some rss calls"
import pydelicious as p
r = []
result = p.getrss(tag="python", popular=0)
r.append(result)
result = p.getrss(tag="python ajax", popular=0)
r.append(result)
result = p.getrss(tag="python", popular=1)
r.append(result)
result = p.getrss(tag="python ajax", popular=1)
... | Python |
""" Library for the syndic8 RPC API """
import xmlrpclib
import time
PROXY = "http://www.syndic8.com/xmlrpc.php"
def _new_instance():
""" Returns a new instance of the syndic8 proxy server """
server = xmlrpclib.ServerProxy(PROXY)
return server.syndic8
def findfeeds(pattern, sortfield='feedid', offset=0,... | Python |
#!/usr/bin/env python
"""Universal feed parser
Handles RSS 0.9x, RSS 1.0, RSS 2.0, CDF, Atom 0.3, and Atom 1.0 feeds
Visit http://feedparser.org/ for the latest version
Visit http://feedparser.org/docs/ for the latest documentation
Required: Python 2.1 or later
Recommended: Python 2.3 or later
Recommended:... | Python |
from xml.sax import make_parser
from xml.sax.handler import feature_namespaces
from xml.sax import handler
from westom.feednut.utils.misc import storage
import xml.parsers.expat
class SubscriptionHandler(handler.ContentHandler):
"""
SubscriptionHandler creates a list of subscriptions from an OPML file... | Python |
"""
FYI: Yahoo puts a limit of 5000 requests per day...
"""
import urllib, string, re
APP_ID = 'yahoo_feednut'
YAHOO_URL = 'http://api.search.yahoo.com/ContentAnalysisService/V1/termExtraction'
RESULT_RE = re.compile('<Result>([\w\s]+)<\/Result>')
#filter out some words we don't want back
FILTER_LIST = ['a', 'for', '... | Python |
""""Scrape 'N' Feed
Simple PyRSS2Gen wrapper for screen-scraping RSS feeds
http://www.crummy.com/software/ScrapeNFeed"""
__author__ = "Leonard Richardson (leonardr@segfault.org)"
__version__ = "1.0.0"
__copyright__ = "Copyright (c) 2005 Leonard Richardson"
__license__ = "PSF"
import datetime
import md5
imp... | Python |
"""Caching dictionary that uses access times to decide which objects to
flush from the cache.
When instantiating, you can set the maximum number of key/value pairs
to maintain in the cache:
c = Cache(size=1000)
When the maximum size of the cache is reached, it will be resized
automatically to 95% of its maximum... | Python |
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll ha... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.