Bladeren bron

[core] Deleting unused files

Romain Rigaux 13 jaren geleden
bovenliggende
commit
e58c95e3ae

+ 0 - 233
desktop/core/ext-py/Django-1.2.3/django/contrib/admin/media/js/dateparse.js

@@ -1,233 +0,0 @@
-/* 'Magic' date parsing, by Simon Willison (6th October 2003)
-   http://simon.incutio.com/archive/2003/10/06/betterDateInput
-   Adapted for 6newslawrence.com, 28th January 2004
-*/
-
-/* Finds the index of the first occurence of item in the array, or -1 if not found */
-if (typeof Array.prototype.indexOf == 'undefined') {
-    Array.prototype.indexOf = function(item) {
-        var len = this.length;
-        for (var i = 0; i < len; i++) {
-            if (this[i] == item) {
-                return i;
-            }
-        }
-        return -1;
-    };
-}
-/* Returns an array of items judged 'true' by the passed in test function */
-if (typeof Array.prototype.filter == 'undefined') {
-    Array.prototype.filter = function(test) {
-        var matches = [];
-        var len = this.length;
-        for (var i = 0; i < len; i++) {
-            if (test(this[i])) {
-                matches[matches.length] = this[i];
-            }
-        }
-        return matches;
-    };
-}
-
-var monthNames = gettext("January February March April May June July August September October November December").split(" ");
-var weekdayNames = gettext("Sunday Monday Tuesday Wednesday Thursday Friday Saturday").split(" ");
-
-/* Takes a string, returns the index of the month matching that string, throws
-   an error if 0 or more than 1 matches
-*/
-function parseMonth(month) {
-    var matches = monthNames.filter(function(item) { 
-        return new RegExp("^" + month, "i").test(item);
-    });
-    if (matches.length == 0) {
-        throw new Error("Invalid month string");
-    }
-    if (matches.length > 1) {
-        throw new Error("Ambiguous month");
-    }
-    return monthNames.indexOf(matches[0]);
-}
-/* Same as parseMonth but for days of the week */
-function parseWeekday(weekday) {
-    var matches = weekdayNames.filter(function(item) {
-        return new RegExp("^" + weekday, "i").test(item);
-    });
-    if (matches.length == 0) {
-        throw new Error("Invalid day string");
-    }
-    if (matches.length > 1) {
-        throw new Error("Ambiguous weekday");
-    }
-    return weekdayNames.indexOf(matches[0]);
-}
-
-/* Array of objects, each has 're', a regular expression and 'handler', a 
-   function for creating a date from something that matches the regular 
-   expression. Handlers may throw errors if string is unparseable. 
-*/
-var dateParsePatterns = [
-    // Today
-    {   re: /^tod/i,
-        handler: function() { 
-            return new Date();
-        } 
-    },
-    // Tomorrow
-    {   re: /^tom/i,
-        handler: function() {
-            var d = new Date(); 
-            d.setDate(d.getDate() + 1); 
-            return d;
-        }
-    },
-    // Yesterday
-    {   re: /^yes/i,
-        handler: function() {
-            var d = new Date();
-            d.setDate(d.getDate() - 1);
-            return d;
-        }
-    },
-    // 4th
-    {   re: /^(\d{1,2})(st|nd|rd|th)?$/i, 
-        handler: function(bits) {
-            var d = new Date();
-            d.setDate(parseInt(bits[1], 10));
-            return d;
-        }
-    },
-    // 4th Jan
-    {   re: /^(\d{1,2})(?:st|nd|rd|th)? (\w+)$/i, 
-        handler: function(bits) {
-            var d = new Date();
-            d.setDate(parseInt(bits[1], 10));
-            d.setMonth(parseMonth(bits[2]));
-            return d;
-        }
-    },
-    // 4th Jan 2003
-    {   re: /^(\d{1,2})(?:st|nd|rd|th)? (\w+),? (\d{4})$/i,
-        handler: function(bits) {
-            var d = new Date();
-            d.setDate(parseInt(bits[1], 10));
-            d.setMonth(parseMonth(bits[2]));
-            d.setYear(bits[3]);
-            return d;
-        }
-    },
-    // Jan 4th
-    {   re: /^(\w+) (\d{1,2})(?:st|nd|rd|th)?$/i, 
-        handler: function(bits) {
-            var d = new Date();
-            d.setDate(parseInt(bits[2], 10));
-            d.setMonth(parseMonth(bits[1]));
-            return d;
-        }
-    },
-    // Jan 4th 2003
-    {   re: /^(\w+) (\d{1,2})(?:st|nd|rd|th)?,? (\d{4})$/i,
-        handler: function(bits) {
-            var d = new Date();
-            d.setDate(parseInt(bits[2], 10));
-            d.setMonth(parseMonth(bits[1]));
-            d.setYear(bits[3]);
-            return d;
-        }
-    },
-    // next Tuesday - this is suspect due to weird meaning of "next"
-    {   re: /^next (\w+)$/i,
-        handler: function(bits) {
-            var d = new Date();
-            var day = d.getDay();
-            var newDay = parseWeekday(bits[1]);
-            var addDays = newDay - day;
-            if (newDay <= day) {
-                addDays += 7;
-            }
-            d.setDate(d.getDate() + addDays);
-            return d;
-        }
-    },
-    // last Tuesday
-    {   re: /^last (\w+)$/i,
-        handler: function(bits) {
-            throw new Error("Not yet implemented");
-        }
-    },
-    // mm/dd/yyyy (American style)
-    {   re: /(\d{1,2})\/(\d{1,2})\/(\d{4})/,
-        handler: function(bits) {
-            var d = new Date();
-            d.setYear(bits[3]);
-            d.setDate(parseInt(bits[2], 10));
-            d.setMonth(parseInt(bits[1], 10) - 1); // Because months indexed from 0
-            return d;
-        }
-    },
-    // yyyy-mm-dd (ISO style)
-    {   re: /(\d{4})-(\d{1,2})-(\d{1,2})/,
-        handler: function(bits) {
-            var d = new Date();
-            d.setYear(parseInt(bits[1]));
-            d.setMonth(parseInt(bits[2], 10) - 1);
-            d.setDate(parseInt(bits[3], 10));
-            return d;
-        }
-    },
-];
-
-function parseDateString(s) {
-    for (var i = 0; i < dateParsePatterns.length; i++) {
-        var re = dateParsePatterns[i].re;
-        var handler = dateParsePatterns[i].handler;
-        var bits = re.exec(s);
-        if (bits) {
-            return handler(bits);
-        }
-    }
-    throw new Error("Invalid date string");
-}
-
-function fmt00(x) {
-    // fmt00: Tags leading zero onto numbers 0 - 9.
-    // Particularly useful for displaying results from Date methods.
-    //
-    if (Math.abs(parseInt(x)) < 10){
-        x = "0"+ Math.abs(x);
-    }
-    return x;
-}
-
-function parseDateStringISO(s) {
-    try {
-        var d = parseDateString(s);
-        return d.getFullYear() + '-' + (fmt00(d.getMonth() + 1)) + '-' + fmt00(d.getDate())
-    }
-    catch (e) { return s; }
-}
-function magicDate(input) {
-    var messagespan = input.id + 'Msg';
-    try {
-        var d = parseDateString(input.value);
-        input.value = d.getFullYear() + '-' + (fmt00(d.getMonth() + 1)) + '-' + 
-            fmt00(d.getDate());
-        input.className = '';
-        // Human readable date
-        if (document.getElementById(messagespan)) {
-            document.getElementById(messagespan).firstChild.nodeValue = d.toDateString();
-            document.getElementById(messagespan).className = 'normal';
-        }
-    }
-    catch (e) {
-        input.className = 'error';
-        var message = e.message;
-        // Fix for IE6 bug
-        if (message.indexOf('is null or not an object') > -1) {
-            message = 'Invalid date string';
-        }
-        if (document.getElementById(messagespan)) {
-            document.getElementById(messagespan).firstChild.nodeValue = message;
-            document.getElementById(messagespan).className = 'error';
-        }
-    }
-}

+ 0 - 361
desktop/core/ext-py/Django-1.2.3/django/contrib/gis/utils/geoip.py

@@ -1,361 +0,0 @@
-"""
- This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R)
- C API (http://www.maxmind.com/app/c).  This is an alternative to the GPL
- licensed Python GeoIP interface provided by MaxMind.
-
- GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts.
-
- For IP-based geolocation, this module requires the GeoLite Country and City
- datasets, in binary format (CSV will not work!).  The datasets may be
- downloaded from MaxMind at http://www.maxmind.com/download/geoip/database/.
- Grab GeoIP.dat.gz and GeoLiteCity.dat.gz, and unzip them in the directory
- corresponding to settings.GEOIP_PATH.  See the GeoIP docstring and examples
- below for more details.
-
- TODO: Verify compatibility with Windows.
-
- Example:
-
- >>> from django.contrib.gis.utils import GeoIP
- >>> g = GeoIP()
- >>> g.country('google.com')
- {'country_code': 'US', 'country_name': 'United States'}
- >>> g.city('72.14.207.99')
- {'area_code': 650,
- 'city': 'Mountain View',
- 'country_code': 'US',
- 'country_code3': 'USA',
- 'country_name': 'United States',
- 'dma_code': 807,
- 'latitude': 37.419200897216797,
- 'longitude': -122.05740356445312,
- 'postal_code': '94043',
- 'region': 'CA'}
- >>> g.lat_lon('salon.com')
- (37.789798736572266, -122.39420318603516)
- >>> g.lon_lat('uh.edu')
- (-95.415199279785156, 29.77549934387207)
- >>> g.geos('24.124.1.80').wkt
- 'POINT (-95.2087020874023438 39.0392990112304688)'
-"""
-import os, re
-from ctypes import c_char_p, c_float, c_int, Structure, CDLL, POINTER
-from ctypes.util import find_library
-from django.conf import settings
-if not settings.configured: settings.configure()
-
-# Creating the settings dictionary with any settings, if needed.
-GEOIP_SETTINGS = dict((key, getattr(settings, key))
-                      for key in ('GEOIP_PATH', 'GEOIP_LIBRARY_PATH', 'GEOIP_COUNTRY', 'GEOIP_CITY')
-                      if hasattr(settings, key))
-lib_path = GEOIP_SETTINGS.get('GEOIP_LIBRARY_PATH', None)
-
-# GeoIP Exception class.
-class GeoIPException(Exception): pass
-
-# The shared library for the GeoIP C API.  May be downloaded
-#  from http://www.maxmind.com/download/geoip/api/c/
-if lib_path:
-    lib_name = None
-else:
-    # TODO: Is this really the library name for Windows?
-    lib_name = 'GeoIP'
-
-# Getting the path to the GeoIP library.
-if lib_name: lib_path = find_library(lib_name)
-if lib_path is None: raise GeoIPException('Could not find the GeoIP library (tried "%s"). '
-                                          'Try setting GEOIP_LIBRARY_PATH in your settings.' % lib_name)
-lgeoip = CDLL(lib_path)
-
-# Regular expressions for recognizing IP addresses and the GeoIP
-# free database editions.
-ipregex = re.compile(r'^(?P<w>\d\d?\d?)\.(?P<x>\d\d?\d?)\.(?P<y>\d\d?\d?)\.(?P<z>\d\d?\d?)$')
-free_regex = re.compile(r'^GEO-\d{3}FREE')
-lite_regex = re.compile(r'^GEO-\d{3}LITE')
-
-#### GeoIP C Structure definitions ####
-class GeoIPRecord(Structure):
-    _fields_ = [('country_code', c_char_p),
-                ('country_code3', c_char_p),
-                ('country_name', c_char_p),
-                ('region', c_char_p),
-                ('city', c_char_p),
-                ('postal_code', c_char_p),
-                ('latitude', c_float),
-                ('longitude', c_float),
-                # TODO: In 1.4.6 this changed from `int dma_code;` to
-                # `union {int metro_code; int dma_code;};`.  Change
-                # to a `ctypes.Union` in to accomodate in future when
-                # pre-1.4.6 versions are no longer distributed.
-                ('dma_code', c_int),
-                ('area_code', c_int),
-                # TODO: The following structure fields were added in 1.4.3 --
-                # uncomment these fields when sure previous versions are no
-                # longer distributed by package maintainers.
-                #('charset', c_int),
-                #('continent_code', c_char_p),
-                ]
-class GeoIPTag(Structure): pass
-
-#### ctypes function prototypes ####
-RECTYPE = POINTER(GeoIPRecord)
-DBTYPE = POINTER(GeoIPTag)
-
-# For retrieving records by name or address.
-def record_output(func):
-    func.restype = RECTYPE
-    return func
-rec_by_addr = record_output(lgeoip.GeoIP_record_by_addr)
-rec_by_name = record_output(lgeoip.GeoIP_record_by_name)
-
-# For opening & closing GeoIP database files.
-geoip_open = lgeoip.GeoIP_open
-geoip_open.restype = DBTYPE
-geoip_close = lgeoip.GeoIP_delete
-geoip_close.argtypes = [DBTYPE]
-geoip_close.restype = None
-
-# String output routines.
-def string_output(func):
-    func.restype = c_char_p
-    return func
-geoip_dbinfo = string_output(lgeoip.GeoIP_database_info)
-cntry_code_by_addr = string_output(lgeoip.GeoIP_country_code_by_addr)
-cntry_code_by_name = string_output(lgeoip.GeoIP_country_code_by_name)
-cntry_name_by_addr = string_output(lgeoip.GeoIP_country_name_by_addr)
-cntry_name_by_name = string_output(lgeoip.GeoIP_country_name_by_name)
-
-#### GeoIP class ####
-class GeoIP(object):
-    # The flags for GeoIP memory caching.
-    # GEOIP_STANDARD - read database from filesystem, uses least memory.
-    #
-    # GEOIP_MEMORY_CACHE - load database into memory, faster performance
-    #        but uses more memory
-    #
-    # GEOIP_CHECK_CACHE - check for updated database.  If database has been updated,
-    #        reload filehandle and/or memory cache.
-    #
-    # GEOIP_INDEX_CACHE - just cache
-    #        the most frequently accessed index portion of the database, resulting
-    #        in faster lookups than GEOIP_STANDARD, but less memory usage than
-    #        GEOIP_MEMORY_CACHE - useful for larger databases such as
-    #        GeoIP Organization and GeoIP City.  Note, for GeoIP Country, Region
-    #        and Netspeed databases, GEOIP_INDEX_CACHE is equivalent to GEOIP_MEMORY_CACHE
-    #
-    GEOIP_STANDARD = 0
-    GEOIP_MEMORY_CACHE = 1
-    GEOIP_CHECK_CACHE = 2
-    GEOIP_INDEX_CACHE = 4
-    cache_options = dict((opt, None) for opt in (0, 1, 2, 4))
-    _city_file = ''
-    _country_file = ''
-
-    # Initially, pointers to GeoIP file references are NULL.
-    _city = None
-    _country = None
-
-    def __init__(self, path=None, cache=0, country=None, city=None):
-        """
-        Initializes the GeoIP object, no parameters are required to use default
-        settings.  Keyword arguments may be passed in to customize the locations
-        of the GeoIP data sets.
-
-        * path: Base directory to where GeoIP data is located or the full path
-            to where the city or country data files (*.dat) are located.
-            Assumes that both the city and country data sets are located in
-            this directory; overrides the GEOIP_PATH settings attribute.
-
-        * cache: The cache settings when opening up the GeoIP datasets,
-            and may be an integer in (0, 1, 2, 4) corresponding to
-            the GEOIP_STANDARD, GEOIP_MEMORY_CACHE, GEOIP_CHECK_CACHE,
-            and GEOIP_INDEX_CACHE `GeoIPOptions` C API settings,
-            respectively.  Defaults to 0, meaning that the data is read
-            from the disk.
-
-        * country: The name of the GeoIP country data file.  Defaults to
-            'GeoIP.dat'; overrides the GEOIP_COUNTRY settings attribute.
-
-        * city: The name of the GeoIP city data file.  Defaults to
-            'GeoLiteCity.dat'; overrides the GEOIP_CITY settings attribute.
-        """
-        # Checking the given cache option.
-        if cache in self.cache_options:
-            self._cache = self.cache_options[cache]
-        else:
-            raise GeoIPException('Invalid caching option: %s' % cache)
-
-        # Getting the GeoIP data path.
-        if not path:
-            path = GEOIP_SETTINGS.get('GEOIP_PATH', None)
-            if not path: raise GeoIPException('GeoIP path must be provided via parameter or the GEOIP_PATH setting.')
-        if not isinstance(path, basestring):
-            raise TypeError('Invalid path type: %s' % type(path).__name__)
-
-        if os.path.isdir(path):
-            # Constructing the GeoIP database filenames using the settings
-            # dictionary.  If the database files for the GeoLite country
-            # and/or city datasets exist, then try and open them.
-            country_db = os.path.join(path, country or GEOIP_SETTINGS.get('GEOIP_COUNTRY', 'GeoIP.dat'))
-            if os.path.isfile(country_db):
-                self._country = geoip_open(country_db, cache)
-                self._country_file = country_db
-
-            city_db = os.path.join(path, city or GEOIP_SETTINGS.get('GEOIP_CITY', 'GeoLiteCity.dat'))
-            if os.path.isfile(city_db):
-                self._city = geoip_open(city_db, cache)
-                self._city_file = city_db
-        elif os.path.isfile(path):
-            # Otherwise, some detective work will be needed to figure
-            # out whether the given database path is for the GeoIP country
-            # or city databases.
-            ptr = geoip_open(path, cache)
-            info = geoip_dbinfo(ptr)
-            if lite_regex.match(info):
-                # GeoLite City database detected.
-                self._city = ptr
-                self._city_file = path
-            elif free_regex.match(info):
-                # GeoIP Country database detected.
-                self._country = ptr
-                self._country_file = path
-            else:
-                raise GeoIPException('Unable to recognize database edition: %s' % info)
-        else:
-            raise GeoIPException('GeoIP path must be a valid file or directory.')
-
-    def __del__(self):
-        # Cleaning any GeoIP file handles lying around.
-        if self._country: geoip_close(self._country)
-        if self._city: geoip_close(self._city)
-
-    def _check_query(self, query, country=False, city=False, city_or_country=False):
-        "Helper routine for checking the query and database availability."
-        # Making sure a string was passed in for the query.
-        if not isinstance(query, basestring):
-            raise TypeError('GeoIP query must be a string, not type %s' % type(query).__name__)
-
-        # Extra checks for the existence of country and city databases.
-        if city_or_country and not (self._country or self._city):
-            raise GeoIPException('Invalid GeoIP country and city data files.')
-        elif country and not self._country:
-            raise GeoIPException('Invalid GeoIP country data file: %s' % self._country_file)
-        elif city and not self._city:
-            raise GeoIPException('Invalid GeoIP city data file: %s' % self._city_file)
-
-    def city(self, query):
-        """
-        Returns a dictionary of city information for the given IP address or
-        Fully Qualified Domain Name (FQDN).  Some information in the dictionary
-        may be undefined (None).
-        """
-        self._check_query(query, city=True)
-        if ipregex.match(query):
-            # If an IP address was passed in
-            ptr = rec_by_addr(self._city, c_char_p(query))
-        else:
-            # If a FQDN was passed in.
-            ptr = rec_by_name(self._city, c_char_p(query))
-
-        # Checking the pointer to the C structure, if valid pull out elements
-        # into a dicionary and return.
-        if bool(ptr):
-            record = ptr.contents
-            return dict((tup[0], getattr(record, tup[0])) for tup in record._fields_)
-        else:
-            return None
-
-    def country_code(self, query):
-        "Returns the country code for the given IP Address or FQDN."
-        self._check_query(query, city_or_country=True)
-        if self._country:
-            if ipregex.match(query): return cntry_code_by_addr(self._country, query)
-            else: return cntry_code_by_name(self._country, query)
-        else:
-            return self.city(query)['country_code']
-
-    def country_name(self, query):
-        "Returns the country name for the given IP Address or FQDN."
-        self._check_query(query, city_or_country=True)
-        if self._country:
-            if ipregex.match(query): return cntry_name_by_addr(self._country, query)
-            else: return cntry_name_by_name(self._country, query)
-        else:
-            return self.city(query)['country_name']
-
-    def country(self, query):
-        """
-        Returns a dictonary with with the country code and name when given an
-        IP address or a Fully Qualified Domain Name (FQDN).  For example, both
-        '24.124.1.80' and 'djangoproject.com' are valid parameters.
-        """
-        # Returning the country code and name
-        return {'country_code' : self.country_code(query),
-                'country_name' : self.country_name(query),
-                }
-
-    #### Coordinate retrieval routines ####
-    def coords(self, query, ordering=('longitude', 'latitude')):
-        cdict = self.city(query)
-        if cdict is None: return None
-        else: return tuple(cdict[o] for o in ordering)
-
-    def lon_lat(self, query):
-        "Returns a tuple of the (longitude, latitude) for the given query."
-        return self.coords(query)
-
-    def lat_lon(self, query):
-        "Returns a tuple of the (latitude, longitude) for the given query."
-        return self.coords(query, ('latitude', 'longitude'))
-
-    def geos(self, query):
-        "Returns a GEOS Point object for the given query."
-        ll = self.lon_lat(query)
-        if ll:
-            from django.contrib.gis.geos import Point
-            return Point(ll, srid=4326)
-        else:
-            return None
-
-    #### GeoIP Database Information Routines ####
-    def country_info(self):
-        "Returns information about the GeoIP country database."
-        if self._country is None:
-            ci = 'No GeoIP Country data in "%s"' % self._country_file
-        else:
-            ci = geoip_dbinfo(self._country)
-        return ci
-    country_info = property(country_info)
-
-    def city_info(self):
-        "Retuns information about the GeoIP city database."
-        if self._city is None:
-            ci = 'No GeoIP City data in "%s"' % self._city_file
-        else:
-            ci = geoip_dbinfo(self._city)
-        return ci
-    city_info = property(city_info)
-
-    def info(self):
-        "Returns information about all GeoIP databases in use."
-        return 'Country:\n\t%s\nCity:\n\t%s' % (self.country_info, self.city_info)
-    info = property(info)
-
-    #### Methods for compatibility w/the GeoIP-Python API. ####
-    @classmethod
-    def open(cls, full_path, cache):
-        return GeoIP(full_path, cache)
-
-    def _rec_by_arg(self, arg):
-        if self._city:
-            return self.city(arg)
-        else:
-            return self.country(arg)
-    region_by_addr = city
-    region_by_name = city
-    record_by_addr = _rec_by_arg
-    record_by_name = _rec_by_arg
-    country_code_by_addr = country_code
-    country_code_by_name = country_code
-    country_name_by_addr = country_name
-    country_name_by_name = country_name

+ 0 - 223
desktop/core/ext-py/Django-1.2.3/docs/ref/contrib/gis/geoip.txt

@@ -1,223 +0,0 @@
-.. _ref-geoip:
-
-======================
-Geolocation with GeoIP
-======================
-
-.. module:: django.contrib.gis.utils.geoip
-   :synopsis: High-level Python interface for MaxMind's GeoIP C library.
-
-.. currentmodule:: django.contrib.gis.utils
-
-The :class:`GeoIP` object is a ctypes wrapper for the
-`MaxMind GeoIP C API`__. [#]_  This interface is a BSD-licensed alternative
-to the GPL-licensed `Python GeoIP`__ interface provided by MaxMind.
-
-In order to perform IP-based geolocation, the :class:`GeoIP` object requires
-the GeoIP C libary and either the GeoIP `Country`__ or `City`__ 
-datasets in binary format (the CSV files will not work!).  These datasets may be 
-`downloaded from MaxMind`__.  Grab the ``GeoIP.dat.gz`` and ``GeoLiteCity.dat.gz``
-and unzip them in a directory corresponding to what you set 
-``GEOIP_PATH`` with in your settings.  See the example and reference below
-for more details.
-
-__ http://www.maxmind.com/app/c
-__ http://www.maxmind.com/app/python
-__ http://www.maxmind.com/app/country
-__ http://www.maxmind.com/app/city
-__ http://www.maxmind.com/download/geoip/database/
-
-Example
-=======
-
-Assuming you have the GeoIP C library installed, here is an example of its
-usage::
-
-     >>> from django.contrib.gis.utils import GeoIP
-     >>> g = GeoIP()
-     >>> g.country('google.com')
-     {'country_code': 'US', 'country_name': 'United States'}
-     >>> g.city('72.14.207.99')
-     {'area_code': 650,
-     'city': 'Mountain View',
-     'country_code': 'US',
-     'country_code3': 'USA',
-     'country_name': 'United States',
-     'dma_code': 807,
-     'latitude': 37.419200897216797,
-     'longitude': -122.05740356445312,
-     'postal_code': '94043',
-     'region': 'CA'}
-     >>> g.lat_lon('salon.com')
-     (37.789798736572266, -122.39420318603516)
-     >>> g.lon_lat('uh.edu')
-     (-95.415199279785156, 29.77549934387207) 
-     >>> g.geos('24.124.1.80').wkt
-     'POINT (-95.2087020874023438 39.0392990112304688)'
-
-``GeoIP`` Settings
-==================
-
-.. setting:: GEOIP_PATH
-
-GEOIP_PATH
-----------
-
-A string specifying the directory where the GeoIP data files are
-located.  This setting is *required* unless manually specified
-with ``path`` keyword when initializing the :class:`GeoIP` object.
-
-.. setting:: GEOIP_LIBRARY_PATH
-
-GEOIP_LIBRARY_PATH
-------------------
-
-A string specifying the location of the GeoIP C library.  Typically,
-this setting is only used if the GeoIP C library is in a non-standard
-location (e.g., ``/home/sue/lib/libGeoIP.so``).
-
-.. setting:: GEOIP_COUNTRY
-
-GEOIP_COUNTRY
--------------
-
-The basename to use for the GeoIP country data file.
-Defaults to ``'GeoIP.dat'``.
-
-.. setting:: GEOIP_CITY
-
-GEOIP_CITY
-----------
-
-The basename to use for the GeoIP city data file.
-Defaults to ``'GeoLiteCity.dat'``.
-
-``GeoIP`` API
-=============
-
-.. class:: GeoIP([path=None, cache=0, country=None, city=None])
-
-The ``GeoIP`` object does not require any parameters to use the default 
-settings.  However, at the very least the :setting:`GEOIP_PATH` setting
-should be set with the path of the location of your GeoIP data sets.  The 
-following intialization keywords may be used to customize any of the 
-defaults. 
-
-===================  =======================================================
-Keyword Arguments    Description
-===================  =======================================================
-``path``             Base directory to where GeoIP data is located or the 
-                     full path to where the city or country data files 
-                     (.dat) are located.  Assumes that both the city and 
-                     country data sets are located in this directory; 
-                     overrides the :setting:`GEOIP_PATH` settings attribute.
-
-``cache``            The cache settings when opening up the GeoIP datasets,
-                     and may be an integer in (0, 1, 2, 4) corresponding to
-                     the ``GEOIP_STANDARD``, ``GEOIP_MEMORY_CACHE``, 
-                     ``GEOIP_CHECK_CACHE``, and ``GEOIP_INDEX_CACHE`` 
-                     ``GeoIPOptions`` C API settings, respectively. 
-                     Defaults to 0 (``GEOIP_STANDARD``).
- 
-``country``          The name of the GeoIP country data file.  Defaults
-                     to ``GeoIP.dat``.  Setting this keyword overrides the 
-                     :setting:`GEOIP_COUNTRY` settings attribute.
-
-``city``             The name of the GeoIP city data file.  Defaults to
-                     ``GeoLiteCity.dat``.  Setting this keyword overrides
-                     the :setting:`GEOIP_CITY` settings attribute.
-===================  =======================================================
-
-``GeoIP`` Methods
-=================
-
-Querying
---------
-
-All the following querying routines may take either a string IP address
-or a fully qualified domain name (FQDN).  For example, both 
-``'24.124.1.80'`` and ``'djangoproject.com'`` would be valid query 
-parameters. 
-
-.. method:: GeoIP.city(query)
-
-Returns a dictionary of city information for the given query.  Some
-of the values in the dictionary may be undefined (``None``).
-
-.. method:: GeoIPcountry(query)
-
-Returns a dictionary with the country code and country for the given 
-query.
-
-.. method:: GeoIP.country_code(query)
-
-Returns only the country code corresponding to the query.
-
-.. method:: GeoIP.country_name(query)
-
-Returns only the country name corresponding to the query.
-
-Coordinate Retrieval
---------------------
-
-.. method:: GeoIP.coords(query)
-
-Returns a coordinate tuple of (longitude, latitude).
-
-.. method:: GeoIP.lon_lat(query)
-
-Returns a coordinate tuple of (longitude, latitude).
-
-.. method:: GeoIP.lat_lon(query)
-
-Returns a coordinate tuple of (latitude, longitude),
-
-.. method:: GeoIP.geos(query)
-
-Returns a :class:`django.contrib.gis.geos.Point` object corresponding to the query.
-
-Database Information
---------------------
-
-.. attribute:: GeoIP.country_info
-
-This property returns information about the GeoIP country database.
-
-.. attribute:: GeoIP.city_info
-
-This property returns information about the GeoIP city database.
-
-.. attribute:: GeoIP.info
-
-This property returns information about all GeoIP databases (both city
-and country).
-
-GeoIP-Python API compatibility methods
-----------------------------------------
-
-These methods exist to ease compatibility with any code using MaxMind's 
-existing Python API.
-
-.. classmethod:: GeoIP.open(path, cache)
-
-This classmethod instantiates the GeoIP object from the given database path
-and given cache setting.
-
-.. method:: GeoIP.region_by_addr(query)
-
-.. method:: GeoIP.region_by_name(query)
-
-.. method:: GeoIP.record_by_addr(query)
-
-.. method:: GeoIP.record_by_name(query)
-
-.. method:: GeoIP.country_code_by_addr(query)
-
-.. method:: GeoIP.country_code_by_name(query)
-
-.. method:: GeoIP.country_name_by_addr(query)
-
-.. method:: GeoIP.country_name_by_name(query)
-
-.. rubric:: Footnotes
-.. [#] GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts.

+ 0 - 158
desktop/core/ext-py/Pygments-1.3.1/tests/examplefiles/Constants.mo

@@ -1,158 +0,0 @@
-within Modelica;
-package Constants
-  "Library of mathematical constants and constants of nature (e.g., pi, eps, R, sigma)"
-
-  import SI = Modelica.SIunits;
-  import NonSI = Modelica.SIunits.Conversions.NonSIunits;
-
-  extends Modelica.Icons.Library2;
-
-  // Mathematical constants
-  final constant Real e=Modelica.Math.exp(1.0);
-  final constant Real pi=2*Modelica.Math.asin(1.0); // 3.14159265358979;
-  final constant Real D2R=pi/180 "Degree to Radian";
-  final constant Real R2D=180/pi "Radian to Degree";
-
-  // Machine dependent constants
-  // (the definition is a temporary fix since not adapted to the
-  // machine where the Modelica translator is running)
-  final constant Real eps=1.e-15 "Biggest number such that 1.0 + eps = 1.0";
-  final constant Real small=1.e-60
-    "Smallest number such that small and -small are representable on the machine";
-  final constant Real inf=1.e+60
-    "Biggest Real number such that inf and -inf are representable on the machine";
-  final constant Integer Integer_inf=2147483647
-    "Biggest Integer number such that Integer_inf and -Integer_inf are representable on the machine";
-
-  // Constants of nature
-  // (name, value, description from http://physics.nist.gov/cuu/Constants/)
-  final constant SI.Velocity c=299792458 "Speed of light in vacuum";
-  final constant SI.Acceleration g_n=9.80665
-    "Standard acceleration of gravity on earth";
-  final constant Real G(final unit="m3/(kg.s2)") = 6.6742e-11
-    "Newtonian constant of gravitation";
-  final constant SI.FaradayConstant F = 9.64853399e4 "Faraday constant, C/mol";
-  final constant Real h(final unit="J.s") = 6.6260693e-34 "Planck constant";
-  final constant Real k(final unit="J/K") = 1.3806505e-23 "Boltzmann constant";
-  final constant Real R(final unit="J/(mol.K)") = 8.314472 "Molar gas constant";
-  final constant Real sigma(final unit="W/(m2.K4)") = 5.670400e-8
-    "Stefan-Boltzmann constant";
-  final constant Real N_A(final unit="1/mol") = 6.0221415e23
-    "Avogadro constant";
-  final constant Real mue_0(final unit="N/A2") = 4*pi*1.e-7 "Magnetic constant";
-  final constant Real epsilon_0(final unit="F/m") = 1/(mue_0*c*c)
-    "Electric constant";
-  final constant NonSI.Temperature_degC T_zero=-273.15
-    "Absolute zero temperature";
-
-  annotation (
-    Documentation(info="<html>
-<p>
-This package provides often needed constants from mathematics, machine
-dependent constants and constants from nature. The latter constants
-(name, value, description) are from the following source:
-</p>
-
-<dl>
-<dt>Peter J. Mohr and Barry N. Taylor (1999):</dt>
-<dd><b>CODATA Recommended Values of the Fundamental Physical Constants: 1998</b>.
-    Journal of Physical and Chemical Reference Data, Vol. 28, No. 6, 1999 and
-    Reviews of Modern Physics, Vol. 72, No. 2, 2000. See also <a href=
-\"http://physics.nist.gov/cuu/Constants/\">http://physics.nist.gov/cuu/Constants/</a></dd>
-</dl>
-
-<p>CODATA is the Committee on Data for Science and Technology.</p>
-
-<dl>
-<dt><b>Main Author:</b></dt>
-<dd><a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a><br>
-    Deutsches Zentrum f&uuml;r Luft und Raumfahrt e. V. (DLR)<br>
-    Oberpfaffenhofen<br>
-    Postfach 11 16<br>
-    D-82230 We&szlig;ling<br>
-    email: <a href=\"mailto:Martin.Otter@dlr.de\">Martin.Otter@dlr.de</a></dd>
-</dl>
-
-
-<p>
-Copyright &copy; 1998-2009, Modelica Association and DLR.
-</p>
-<p>
-<i>This Modelica package is <b>free</b> software; it can be redistributed and/or modified
-under the terms of the <b>Modelica license</b>, see the license conditions
-and the accompanying <b>disclaimer</b> 
-<a href=\"Modelica://Modelica.UsersGuide.ModelicaLicense\">here</a>.</i>
-</p><br>
-</html>
-", revisions="<html>
-<ul>
-<li><i>Nov 8, 2004</i>
-       by <a href=\"http://www.robotic.dlr.de/Christian.Schweiger/\">Christian Schweiger</a>:<br>
-       Constants updated according to 2002 CODATA values.</li>
-<li><i>Dec 9, 1999</i>
-       by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br>
-       Constants updated according to 1998 CODATA values. Using names, values
-       and description text from this source. Included magnetic and
-       electric constant.</li>
-<li><i>Sep 18, 1999</i>
-       by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br>
-       Constants eps, inf, small introduced.</li>
-<li><i>Nov 15, 1997</i>
-       by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br>
-       Realized.</li>
-</ul>
-</html>"),
-    Invisible=true,
-    Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100,
-            100}}), graphics={
-        Line(
-          points={{-34,-38},{12,-38}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-20,-38},{-24,-48},{-28,-56},{-34,-64}},
-          color={0,0,0},
-          thickness=0.5),
-        Line(
-          points={{-2,-38},{2,-46},{8,-56},{14,-64}},
-          color={0,0,0},
-          thickness=0.5)}),
-    Diagram(graphics={
-        Rectangle(
-          extent={{200,162},{380,312}},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid,
-          lineColor={0,0,255}),
-        Polygon(
-          points={{200,312},{220,332},{400,332},{380,312},{200,312}},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid,
-          lineColor={0,0,255}),
-        Polygon(
-          points={{400,332},{400,182},{380,162},{380,312},{400,332}},
-          fillColor={235,235,235},
-          fillPattern=FillPattern.Solid,
-          lineColor={0,0,255}),
-        Text(
-          extent={{210,302},{370,272}},
-          lineColor={160,160,164},
-          fillColor={0,0,0},
-          fillPattern=FillPattern.Solid,
-          textString="Library"),
-        Line(
-          points={{266,224},{312,224}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{280,224},{276,214},{272,206},{266,198}},
-          color={0,0,0},
-          thickness=1),
-        Line(
-          points={{298,224},{302,216},{308,206},{314,198}},
-          color={0,0,0},
-          thickness=1),
-        Text(
-          extent={{152,412},{458,334}},
-          lineColor={255,0,0},
-          textString="Modelica.Constants")}));
-end Constants;

+ 0 - 1852
desktop/core/ext-py/Pygments-1.3.1/tests/examplefiles/example.rb

@@ -1,1852 +0,0 @@
-module CodeRay
-	module Scanners
-
-class Ruby < Scanner
-
-	RESERVED_WORDS = [
-		'and', 'def', 'end', 'in', 'or', 'unless', 'begin',
-		'defined?', 'ensure', 'module', 'redo', 'super', 'until',
-		'BEGIN', 'break', 'do', 'next', 'rescue', 'then',
-		'when', 'END', 'case', 'else', 'for', 'retry',
-		'while', 'alias', 'class', 'elsif', 'if', 'not', 'return',
-		'undef', 'yield',
-	]
-
-	DEF_KEYWORDS = ['def']
-	MODULE_KEYWORDS = ['class', 'module']
-	DEF_NEW_STATE = WordList.new(:initial).
-		add(DEF_KEYWORDS, :def_expected).
-		add(MODULE_KEYWORDS, :module_expected)
-
-	WORDS_ALLOWING_REGEXP = [
-		'and', 'or', 'not', 'while', 'until', 'unless', 'if', 'elsif', 'when'
-	]
-	REGEXP_ALLOWED = WordList.new(false).
-		add(WORDS_ALLOWING_REGEXP, :set)
-
-	PREDEFINED_CONSTANTS = [
-		'nil', 'true', 'false', 'self',
-		'DATA', 'ARGV', 'ARGF', '__FILE__', '__LINE__',
-	]
-
-	IDENT_KIND = WordList.new(:ident).
-		add(RESERVED_WORDS, :reserved).
-		add(PREDEFINED_CONSTANTS, :pre_constant)
-
-	METHOD_NAME = / #{IDENT} [?!]? /xo
-	METHOD_NAME_EX = /
-	 #{METHOD_NAME}  # common methods: split, foo=, empty?, gsub!
-	 | \*\*?         # multiplication and power
-	 | [-+~]@?       # plus, minus
-	 | [\/%&|^`]     # division, modulo or format strings, &and, |or, ^xor, `system`
-	 | \[\]=?        # array getter and setter
-	 | <=?>? | >=?   # comparison, rocket operator
-	 | << | >>       # append or shift left, shift right
-	 | ===?          # simple equality and case equality
-	/ox
-	GLOBAL_VARIABLE = / \$ (?: #{IDENT} | \d+ | [~&+`'=\/,;_.<>!@0$?*":F\\] | -[a-zA-Z_0-9] ) /ox
-
-	DOUBLEQ = / "  [^"\#\\]*  (?: (?: \#\{.*?\} | \#(?:$")?  | \\. ) [^"\#\\]*  )* "?  /ox
-	SINGLEQ = / '  [^'\\]*    (?:                              \\.   [^'\\]*    )* '?  /ox
-	STRING  = / #{SINGLEQ} | #{DOUBLEQ} /ox
-	SHELL   = / `  [^`\#\\]*  (?: (?: \#\{.*?\} | \#(?:$`)?  | \\. ) [^`\#\\]*  )* `?  /ox
-	REGEXP  = / \/ [^\/\#\\]* (?: (?: \#\{.*?\} | \#(?:$\/)? | \\. ) [^\/\#\\]* )* \/? /ox
-
-	DECIMAL = /\d+(?:_\d+)*/  # doesn't recognize 09 as octal error
-	OCTAL = /0_?[0-7]+(?:_[0-7]+)*/
-	HEXADECIMAL = /0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*/
-	BINARY = /0b[01]+(?:_[01]+)*/
-
-	EXPONENT = / [eE] [+-]? #{DECIMAL} /ox
-	FLOAT = / #{DECIMAL} (?: #{EXPONENT} | \. #{DECIMAL} #{EXPONENT}? ) /
-	INTEGER = /#{OCTAL}|#{HEXADECIMAL}|#{BINARY}|#{DECIMAL}/
-
-	def reset
-		super
-		@regexp_allowed = false
-	end
-
-	def next_token
-		return if @scanner.eos?
-
-		kind = :error
-		if @scanner.scan(/\s+/)  # in every state
-			kind = :space
-			@regexp_allowed = :set if @regexp_allowed or @scanner.matched.index(?\n)  # delayed flag setting
-
-		elsif @state == :def_expected
-			if @scanner.scan(/ (?: (?:#{IDENT}(?:\.|::))* | (?:@@?|$)? #{IDENT}(?:\.|::) ) #{METHOD_NAME_EX} /ox)
-				kind = :method
-				@state = :initial
-			else
-				@scanner.getch
-			end
-			@state = :initial
-
-		elsif @state == :module_expected
-			if @scanner.scan(/<</)
-				kind = :operator
-			else
-				if @scanner.scan(/ (?: #{IDENT} (?:\.|::))* #{IDENT} /ox)
-					kind = :method
-				else
-					@scanner.getch
-				end
-				@state = :initial
-			end
-
-		elsif # state == :initial
-			# IDENTIFIERS, KEYWORDS
-			if @scanner.scan(GLOBAL_VARIABLE)
-				kind = :global_variable
-			elsif @scanner.scan(/ @@ #{IDENT} /ox)
-				kind = :class_variable
-			elsif @scanner.scan(/ @ #{IDENT} /ox)
-				kind = :instance_variable
-			elsif @scanner.scan(/ __END__\n ( (?!\#CODE\#) .* )? | \#[^\n]* | =begin(?=\s).*? \n=end(?=\s|\z)(?:[^\n]*)? /mx)
-				kind = :comment
-			elsif @scanner.scan(METHOD_NAME)
-				if @last_token_dot
-					kind = :ident
-				else
-					matched = @scanner.matched
-					kind = IDENT_KIND[matched]
-					if kind == :ident and matched =~ /^[A-Z]/
-						kind = :constant
-					elsif kind == :reserved
-						@state = DEF_NEW_STATE[matched]
-						@regexp_allowed = REGEXP_ALLOWED[matched]
-					end
-				end
-
-			elsif @scanner.scan(STRING)
-				kind = :string
-			elsif @scanner.scan(SHELL)
-				kind = :shell
-			elsif @scanner.scan(/<<
-				(?:
-					([a-zA-Z_0-9]+)
-						(?: .*? ^\1$ | .* )
-				|
-					-([a-zA-Z_0-9]+)
-						(?: .*? ^\s*\2$ | .* )
-				|
-					(["\'`]) (.+?) \3
-						(?: .*? ^\4$ | .* )
-				|
-					- (["\'`]) (.+?) \5
-						(?: .*? ^\s*\6$ | .* )
-				)
-			/mxo)
-				kind = :string
-			elsif @scanner.scan(/\//) and @regexp_allowed
-				@scanner.unscan
-				@scanner.scan(REGEXP)
-				kind = :regexp
-/%(?:[Qqxrw](?:\([^)#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^)#\\\\]*)*\)?|\[[^\]#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^\]#\\\\]*)*\]?|\{[^}#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^}#\\\\]*)*\}?|<[^>#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^>#\\\\]*)*>?|([^a-zA-Z\\\\])(?:(?!\1)[^#\\\\])*(?:(?:#\{.*?\}|#|\\\\.)(?:(?!\1)[^#\\\\])*)*\1?)|\([^)#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^)#\\\\]*)*\)?|\[[^\]#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^\]#\\\\]*)*\]?|\{[^}#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^}#\\\\]*)*\}?|<[^>#\\\\]*(?:(?:#\{.*?\}|#|\\\\.)[^>#\\\\]*)*>?|([^a-zA-Z\s\\\\])(?:(?!\2)[^#\\\\])*(?:(?:#\{.*?\}|#|\\\\.)(?:(?!\2)[^#\\\\])*)*\2?|\\\\[^#\\\\]*(?:(?:#\{.*?\}|#)[^#\\\\]*)*\\\\?)/
-			elsif @scanner.scan(/:(?:#{GLOBAL_VARIABLE}|#{METHOD_NAME_EX}|#{STRING})/ox)
-				kind = :symbol
-			elsif @scanner.scan(/
-				\? (?:
-					[^\s\\]
-				|
-					\\ (?:M-\\C-|C-\\M-|M-\\c|c\\M-|c|C-|M-))? (?: \\ (?: . | [0-7]{3} | x[0-9A-Fa-f][0-9A-Fa-f] )
-				)
-			/mox)
-				kind = :integer
-
-			elsif @scanner.scan(/ [-+*\/%=<>;,|&!()\[\]{}~?] | \.\.?\.? | ::? /x)
-				kind = :operator
-				@regexp_allowed = :set if @scanner.matched[-1,1] =~ /[~=!<>|&^,\(\[+\-\/\*%]\z/
-			elsif @scanner.scan(FLOAT)
-				kind = :float
-			elsif @scanner.scan(INTEGER)
-				kind = :integer
-			else
-				@scanner.getch
-			end
-		end
-
-		token = Token.new @scanner.matched, kind
-
-		if kind == :regexp
-			token.text << @scanner.scan(/[eimnosux]*/)
-		end
-
-		@regexp_allowed = (@regexp_allowed == :set)  # delayed flag setting
-
-		token
-	end
-end
-
-register Ruby, 'ruby', 'rb'
-
-	end
-end
-class Set
-  include Enumerable
-
-  # Creates a new set containing the given objects.
-  def self.[](*ary)
-    new(ary)
-  end
-
-  # Creates a new set containing the elements of the given enumerable
-  # object.
-  #
-  # If a block is given, the elements of enum are preprocessed by the
-  # given block.
-  def initialize(enum = nil, &block) # :yields: o
-    @hash ||= Hash.new
-
-    enum.nil? and return
-
-    if block
-      enum.each { |o| add(block[o]) }
-    else
-      merge(enum)
-    end
-  end
-
-  # Copy internal hash.
-  def initialize_copy(orig)
-    @hash = orig.instance_eval{@hash}.dup
-  end
-
-  # Returns the number of elements.
-  def size
-    @hash.size
-  end
-  alias length size
-
-  # Returns true if the set contains no elements.
-  def empty?
-    @hash.empty?
-  end
-
-  # Removes all elements and returns self.
-  def clear
-    @hash.clear
-    self
-  end
-
-  # Replaces the contents of the set with the contents of the given
-  # enumerable object and returns self.
-  def replace(enum)
-    if enum.class == self.class
-      @hash.replace(enum.instance_eval { @hash })
-    else
-      enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-      clear
-      enum.each { |o| add(o) }
-    end
-
-    self
-  end
-
-  # Converts the set to an array.  The order of elements is uncertain.
-  def to_a
-    @hash.keys
-  end
-
-  def flatten_merge(set, seen = Set.new)
-    set.each { |e|
-      if e.is_a?(Set)
-	if seen.include?(e_id = e.object_id)
-	  raise ArgumentError, "tried to flatten recursive Set"
-	end
-
-	seen.add(e_id)
-	flatten_merge(e, seen)
-	seen.delete(e_id)
-      else
-	add(e)
-      end
-    }
-
-    self
-  end
-  protected :flatten_merge
-
-  # Returns a new set that is a copy of the set, flattening each
-  # containing set recursively.
-  def flatten
-    self.class.new.flatten_merge(self)
-  end
-
-  # Equivalent to Set#flatten, but replaces the receiver with the
-  # result in place.  Returns nil if no modifications were made.
-  def flatten!
-    if detect { |e| e.is_a?(Set) }
-      replace(flatten())
-    else
-      nil
-    end
-  end
-
-  # Returns true if the set contains the given object.
-  def include?(o)
-    @hash.include?(o)
-  end
-  alias member? include?
-
-  # Returns true if the set is a superset of the given set.
-  def superset?(set)
-    set.is_a?(Set) or raise ArgumentError, "value must be a set"
-    return false if size < set.size
-    set.all? { |o| include?(o) }
-  end
-
-  # Returns true if the set is a proper superset of the given set.
-  def proper_superset?(set)
-    set.is_a?(Set) or raise ArgumentError, "value must be a set"
-    return false if size <= set.size
-    set.all? { |o| include?(o) }
-  end
-
-  # Returns true if the set is a subset of the given set.
-  def subset?(set)
-    set.is_a?(Set) or raise ArgumentError, "value must be a set"
-    return false if set.size < size
-    all? { |o| set.include?(o) }
-  end
-
-  # Returns true if the set is a proper subset of the given set.
-  def proper_subset?(set)
-    set.is_a?(Set) or raise ArgumentError, "value must be a set"
-    return false if set.size <= size
-    all? { |o| set.include?(o) }
-  end
-
-  # Calls the given block once for each element in the set, passing
-  # the element as parameter.
-  def each
-    @hash.each_key { |o| yield(o) }
-    self
-  end
-
-  # Adds the given object to the set and returns self.  Use +merge+ to
-  # add several elements at once.
-  def add(o)
-    @hash[o] = true
-    self
-  end
-  alias << add
-
-  # Adds the given object to the set and returns self.  If the
-  # object is already in the set, returns nil.
-  def add?(o)
-    if include?(o)
-      nil
-    else
-      add(o)
-    end
-  end
-
-  # Deletes the given object from the set and returns self.  Use +subtract+ to
-  # delete several items at once.
-  def delete(o)
-    @hash.delete(o)
-    self
-  end
-
-  # Deletes the given object from the set and returns self.  If the
-  # object is not in the set, returns nil.
-  def delete?(o)
-    if include?(o)
-      delete(o)
-    else
-      nil
-    end
-  end
-
-  # Deletes every element of the set for which block evaluates to
-  # true, and returns self.
-  def delete_if
-    @hash.delete_if { |o,| yield(o) }
-    self
-  end
-
-  # Do collect() destructively.
-  def collect!
-    set = self.class.new
-    each { |o| set << yield(o) }
-    replace(set)
-  end
-  alias map! collect!
-
-  # Equivalent to Set#delete_if, but returns nil if no changes were
-  # made.
-  def reject!
-    n = size
-    delete_if { |o| yield(o) }
-    size == n ? nil : self
-  end
-
-  # Merges the elements of the given enumerable object to the set and
-  # returns self.
-  def merge(enum)
-    if enum.is_a?(Set)
-      @hash.update(enum.instance_eval { @hash })
-    else
-      enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-      enum.each { |o| add(o) }
-    end
-
-    self
-  end
-
-  # Deletes every element that appears in the given enumerable object
-  # and returns self.
-  def subtract(enum)
-    enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-    enum.each { |o| delete(o) }
-    self
-  end
-
-  # Returns a new set built by merging the set and the elements of the
-  # given enumerable object.
-  def |(enum)
-    enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-    dup.merge(enum)
-  end
-  alias + |		##
-  alias union |		##
-
-  # Returns a new set built by duplicating the set, removing every
-  # element that appears in the given enumerable object.
-  def -(enum)
-    enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-    dup.subtract(enum)
-  end
-  alias difference -	##
-
-  # Returns a new array containing elements common to the set and the
-  # given enumerable object.
-  def &(enum)
-    enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-    n = self.class.new
-    enum.each { |o| n.add(o) if include?(o) }
-    n
-  end
-  alias intersection &	##
-
-  # Returns a new array containing elements exclusive between the set
-  # and the given enumerable object.  (set ^ enum) is equivalent to
-  # ((set | enum) - (set & enum)).
-  def ^(enum)
-    enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-    n = dup
-    enum.each { |o| if n.include?(o) then n.delete(o) else n.add(o) end }
-    n
-  end
-
-  # Returns true if two sets are equal.  The equality of each couple
-  # of elements is defined according to Object#eql?.
-  def ==(set)
-    equal?(set) and return true
-
-    set.is_a?(Set) && size == set.size or return false
-
-    hash = @hash.dup
-    set.all? { |o| hash.include?(o) }
-  end
-
-  def hash	# :nodoc:
-    @hash.hash
-  end
-
-  def eql?(o)	# :nodoc:
-    return false unless o.is_a?(Set)
-    @hash.eql?(o.instance_eval{@hash})
-  end
-
-  # Classifies the set by the return value of the given block and
-  # returns a hash of {value => set of elements} pairs.  The block is
-  # called once for each element of the set, passing the element as
-  # parameter.
-  #
-  # e.g.:
-  #
-  #   require 'set'
-  #   files = Set.new(Dir.glob("*.rb"))
-  #   hash = files.classify { |f| File.mtime(f).year }
-  #   p hash    # => {2000=>#<Set: {"a.rb", "b.rb"}>,
-  #             #     2001=>#<Set: {"c.rb", "d.rb", "e.rb"}>,
-  #             #     2002=>#<Set: {"f.rb"}>}
-  def classify # :yields: o
-    h = {}
-
-    each { |i|
-      x = yield(i)
-      (h[x] ||= self.class.new).add(i)
-    }
-
-    h
-  end
-
-  # Divides the set into a set of subsets according to the commonality
-  # defined by the given block.
-  #
-  # If the arity of the block is 2, elements o1 and o2 are in common
-  # if block.call(o1, o2) is true.  Otherwise, elements o1 and o2 are
-  # in common if block.call(o1) == block.call(o2).
-  #
-  # e.g.:
-  #
-  #   require 'set'
-  #   numbers = Set[1, 3, 4, 6, 9, 10, 11]
-  #   set = numbers.divide { |i,j| (i - j).abs == 1 }
-  #   p set     # => #<Set: {#<Set: {1}>,
-  #             #            #<Set: {11, 9, 10}>,
-  #             #            #<Set: {3, 4}>,
-  #             #            #<Set: {6}>}>
-  def divide(&func)
-    if func.arity == 2
-      require 'tsort'
-
-      class << dig = {}		# :nodoc:
-	include TSort
-
-	alias tsort_each_node each_key
-	def tsort_each_child(node, &block)
-	  fetch(node).each(&block)
-	end
-      end
-
-      each { |u|
-	dig[u] = a = []
-	each{ |v| func.call(u, v) and a << v }
-      }
-
-      set = Set.new()
-      dig.each_strongly_connected_component { |css|
-	set.add(self.class.new(css))
-      }
-      set
-    else
-      Set.new(classify(&func).values)
-    end
-  end
-
-  InspectKey = :__inspect_key__         # :nodoc:
-
-  # Returns a string containing a human-readable representation of the
-  # set. ("#<Set: {element1, element2, ...}>")
-  def inspect
-    ids = (Thread.current[InspectKey] ||= [])
-
-    if ids.include?(object_id)
-      return sprintf('#<%s: {...}>', self.class.name)
-    end
-
-    begin
-      ids << object_id
-      return sprintf('#<%s: {%s}>', self.class, to_a.inspect[1..-2])
-    ensure
-      ids.pop
-    end
-  end
-
-  def pretty_print(pp)	# :nodoc:
-    pp.text sprintf('#<%s: {', self.class.name)
-    pp.nest(1) {
-      pp.seplist(self) { |o|
-	pp.pp o
-      }
-    }
-    pp.text "}>"
-  end
-
-  def pretty_print_cycle(pp)	# :nodoc:
-    pp.text sprintf('#<%s: {%s}>', self.class.name, empty? ? '' : '...')
-  end
-end
-
-# SortedSet implements a set which elements are sorted in order.  See Set.
-class SortedSet < Set
-  @@setup = false
-
-  class << self
-    def [](*ary)	# :nodoc:
-      new(ary)
-    end
-
-    def setup	# :nodoc:
-      @@setup and return
-
-      begin
-	require 'rbtree'
-
-	module_eval %{
-	  def initialize(*args, &block)
-	    @hash = RBTree.new
-	    super
-	  end
-	}
-      rescue LoadError
-	module_eval %{
-	  def initialize(*args, &block)
-	    @keys = nil
-	    super
-	  end
-
-	  def clear
-	    @keys = nil
-	    super
-	  end
-
-	  def replace(enum)
-	    @keys = nil
-	    super
-	  end
-
-	  def add(o)
-	    @keys = nil
-	    @hash[o] = true
-	    self
-	  end
-	  alias << add
-
-	  def delete(o)
-	    @keys = nil
-	    @hash.delete(o)
-	    self
-	  end
-
-	  def delete_if
-	    n = @hash.size
-	    @hash.delete_if { |o,| yield(o) }
-	    @keys = nil if @hash.size != n
-	    self
-	  end
-
-	  def merge(enum)
-	    @keys = nil
-	    super
-	  end
-
-	  def each
-	    to_a.each { |o| yield(o) }
-	  end
-
-	  def to_a
-	    (@keys = @hash.keys).sort! unless @keys
-	    @keys
-	  end
-	}
-      end
-
-      @@setup = true
-    end
-  end
-
-  def initialize(*args, &block)	# :nodoc:
-    SortedSet.setup
-    initialize(*args, &block)
-  end
-end
-
-module Enumerable
-  # Makes a set from the enumerable object with given arguments.
-  def to_set(klass = Set, *args, &block)
-    klass.new(self, *args, &block)
-  end
-end
-
-# =begin
-# == RestricedSet class
-# RestricedSet implements a set with restrictions defined by a given
-# block.
-#
-# === Super class
-#     Set
-#
-# === Class Methods
-# --- RestricedSet::new(enum = nil) { |o| ... }
-# --- RestricedSet::new(enum = nil) { |rset, o| ... }
-#     Creates a new restricted set containing the elements of the given
-#     enumerable object.  Restrictions are defined by the given block.
-#
-#     If the block's arity is 2, it is called with the RestrictedSet
-#     itself and an object to see if the object is allowed to be put in
-#     the set.
-#
-#     Otherwise, the block is called with an object to see if the object
-#     is allowed to be put in the set.
-#
-# === Instance Methods
-# --- restriction_proc
-#     Returns the restriction procedure of the set.
-#
-# =end
-#
-# class RestricedSet < Set
-#   def initialize(*args, &block)
-#     @proc = block or raise ArgumentError, "missing a block"
-#
-#     if @proc.arity == 2
-#       instance_eval %{
-# 	def add(o)
-# 	  @hash[o] = true if @proc.call(self, o)
-# 	  self
-# 	end
-# 	alias << add
-#
-# 	def add?(o)
-# 	  if include?(o) || !@proc.call(self, o)
-# 	    nil
-# 	  else
-# 	    @hash[o] = true
-# 	    self
-# 	  end
-# 	end
-#
-# 	def replace(enum)
-# 	  enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-# 	  clear
-# 	  enum.each { |o| add(o) }
-#
-# 	  self
-# 	end
-#
-# 	def merge(enum)
-# 	  enum.is_a?(Enumerable) or raise ArgumentError, "value must be enumerable"
-# 	  enum.each { |o| add(o) }
-#
-# 	  self
-# 	end
-#       }
-#     else
-#       instance_eval %{
-# 	def add(o)
-#         if @proc.call(o)
-# 	    @hash[o] = true
-#         end
-# 	  self
-# 	end
-# 	alias << add
-#
-# 	def add?(o)
-# 	  if include?(o) || !@proc.call(o)
-# 	    nil
-# 	  else
-# 	    @hash[o] = true
-# 	    self
-# 	  end
-# 	end
-#       }
-#     end
-#
-#     super(*args)
-#   end
-#
-#   def restriction_proc
-#     @proc
-#   end
-# end
-
-if $0 == __FILE__
-  eval DATA.read, nil, $0, __LINE__+4
-end
-
-# = rweb - CGI Support Library
-#
-# Author:: Johannes Barre (mailto:rweb@igels.net)
-# Copyright:: Copyright (c) 2003, 04 by Johannes Barre
-# License:: GNU Lesser General Public License (COPYING, http://www.gnu.org/copyleft/lesser.html)
-# Version:: 0.1.0
-# CVS-ID:: $Id: example.rb 39 2005-11-05 03:33:55Z murphy $
-#
-# == What is Rweb?
-# Rweb is a replacement for the cgi class included in the ruby distribution.
-#
-# == How to use
-#
-# === Basics
-#
-# This class is made to be as easy as possible to use. An example:
-#
-# 	require "rweb"
-#
-# 	web = Rweb.new
-# 	web.out do
-# 		web.puts "Hello world!"
-# 	end
-#
-# The visitor will get a simple "Hello World!" in his browser. Please notice,
-# that won't set html-tags for you, so you should better do something like this:
-#
-# 	require "rweb"
-#
-# 	web = Rweb.new
-# 	web.out do
-# 		web.puts "<html><body>Hello world!</body></html>"
-# 	end
-#
-# === Set headers
-# Of course, it's also possible to tell the browser, that the content of this
-# page is plain text instead of html code:
-#
-# 	require "rweb"
-#
-# 	web = Rweb.new
-# 	web.out do
-# 		web.header("content-type: text/plain")
-# 		web.puts "Hello plain world!"
-# 	end
-#
-# Please remember, headers can't be set after the page content has been send.
-# You have to set all nessessary headers before the first puts oder print. It's
-# possible to cache the content until everything is complete. Doing it this
-# way, you can set headers everywhere.
-#
-# If you set a header twice, the second header will replace the first one. The
-# header name is not casesensitive, it will allways converted in to the
-# capitalised form suggested by the w3c (http://w3.org)
-#
-# === Set cookies
-# Setting cookies is quite easy:
-# 	include 'rweb'
-#
-# 	web = Rweb.new
-# 	Cookie.new("Visits", web.cookies['visits'].to_i +1)
-# 	web.out do
-# 		web.puts "Welcome back! You visited this page #{web.cookies['visits'].to_i +1} times"
-# 	end
-#
-# See the class Cookie for more details.
-#
-# === Get form and cookie values
-# There are four ways to submit data from the browser to the server and your
-# ruby script: via GET, POST, cookies and file upload. Rweb doesn't support
-# file upload by now.
-#
-# 	include 'rweb'
-#
-# 	web = Rweb.new
-# 	web.out do
-# 		web.print "action: #{web.get['action']} "
-# 		web.puts "The value of the cookie 'visits' is #{web.cookies['visits']}"
-# 		web.puts "The post parameter 'test['x']' is #{web.post['test']['x']}"
-# 	end
-
-RWEB_VERSION = "0.1.0"
-RWEB = "rweb/#{RWEB_VERSION}"
-
-#require 'rwebcookie' -> edit by bunny :-)
-
-class Rweb
-    # All parameter submitted via the GET method are available in attribute
-		# get. This is Hash, where every parameter is available as a key-value
-		# pair.
-		#
-		# If your input tag has a name like this one, it's value will be available
-		# as web.get["fieldname"]
-		#  <input name="fieldname">
-		# You can submit values as a Hash
-		#  <input name="text['index']">
-		#  <input name="text['index2']">
-		# will be available as
-		#  web.get["text"]["index"]
-		#  web.get["text"]["index2"]
-		# Integers are also possible
-		#  <input name="int[2]">
-		#  <input name="int[3]['hi']>
-		# will be available as
-		#  web.get["int"][2]
-		#  web.get["int"][3]["hi"]
-		# If you specify no index, the lowest unused index will be used:
-		#  <input name="int[]"><!-- First Field -->
-		#  <input name="int[]"><!-- Second one -->
-		# will be available as
-		#  web.get["int"][0] # First Field
-		#  web.get["int"][1] # Second one
-		# Please notice, this doesn'd work like you might expect:
-		#  <input name="text[index]">
-		# It will not be available as web.get["text"]["index"] but
-		#  web.get["text[index]"]
-    attr_reader :get
-
-    # All parameters submitted via POST are available in the attribute post. It
-		# works like the get attribute.
-		#  <input name="text[0]">
-		# will be available as
-		#  web.post["text"][0]
-		attr_reader :post
-
-    # All cookies submitted by the browser are available in cookies. This is a
-		# Hash, where every cookie is a key-value pair.
-		attr_reader :cookies
-
-    # The name of the browser identification is submitted as USER_AGENT and
-		# available in this attribute.
-		attr_reader :user_agent
-
-    # The IP address of the client.
-		attr_reader :remote_addr
-
-    # Creates a new Rweb object. This should only done once. You can set various
-    # options via the settings hash.
-    #
-    # "cache" => true: Everything you script send to the client will be cached
-    # until the end of the out block or until flush is called. This way, you
-    # can modify headers and cookies even after printing something to the client.
-    #
-    # "safe" => level: Changes the $SAFE attribute. By default, $SAFE will be set
-    # to 1. If $SAFE is already higher than this value, it won't be changed.
-    #
-    # "silend" => true: Normaly, Rweb adds automaticly a header like this
-    # "X-Powered-By: Rweb/x.x.x (Ruby/y.y.y)". With the silend option you can
-    # suppress this.
-    def initialize (settings = {})
-        # {{{
-        @header = {}
-        @cookies = {}
-        @get = {}
-        @post = {}
-
-        # Internal attributes
-        @status = nil
-        @reasonPhrase = nil
-        @setcookies = []
-        @output_started = false;
-        @output_allowed = false;
-
-        @mod_ruby = false
-        @env = ENV.to_hash
-
-        if defined?(MOD_RUBY)
-            @output_method = "mod_ruby"
-            @mod_ruby = true
-        elsif @env['SERVER_SOFTWARE'] =~ /^Microsoft-IIS/i
-            @output_method = "nph"
-        else
-            @output_method = "ph"
-        end
-
-        unless settings.is_a?(Hash)
-            raise TypeError, "settings must be a Hash"
-        end
-        @settings = settings
-
-        unless @settings.has_key?("safe")
-            @settings["safe"] = 1
-        end
-
-        if $SAFE < @settings["safe"]
-            $SAFE = @settings["safe"]
-        end
-
-        unless @settings.has_key?("cache")
-            @settings["cache"] = false
-        end
-
-        # mod_ruby sets no QUERY_STRING variable, if no GET-Parameters are given
-        unless @env.has_key?("QUERY_STRING")
-            @env["QUERY_STRING"] = ""
-        end
-
-        # Now we split the QUERY_STRING by the seperators & and ; or, if
-        # specified, settings['get seperator']
-        unless @settings.has_key?("get seperator")
-            get_args = @env['QUERY_STRING'].split(/[&;]/)
-        else
-            get_args = @env['QUERY_STRING'].split(@settings['get seperator'])
-        end
-
-        get_args.each do | arg |
-            arg_key, arg_val = arg.split(/=/, 2)
-            arg_key = Rweb::unescape(arg_key)
-            arg_val = Rweb::unescape(arg_val)
-
-            # Parse names like name[0], name['text'] or name[]
-            pattern = /^(.+)\[("[^\]]*"|'[^\]]*'|[0-9]*)\]$/
-            keys = []
-            while match = pattern.match(arg_key)
-                arg_key = match[1]
-                keys = [match[2]] + keys
-            end
-            keys = [arg_key] + keys
-
-            akt = @get
-            last = nil
-            lastkey = nil
-            keys.each do |key|
-                if key == ""
-                    # No key specified (like in "test[]"), so we use the
-                    # lowerst unused Integer as key
-                    key = 0
-                    while akt.has_key?(key)
-                        key += 1
-                    end
-                elsif /^[0-9]*$/ =~ key
-                    # If the index is numerical convert it to an Integer
-                    key = key.to_i
-                elsif key[0].chr == "'" || key[0].chr == '"'
-                    key = key[1, key.length() -2]
-                end
-                if !akt.has_key?(key) || !akt[key].class == Hash
-                    # create an empty Hash if there isn't already one
-                    akt[key] = {}
-                end
-                last = akt
-                lastkey = key
-                akt = akt[key]
-            end
-            last[lastkey] = arg_val
-        end
-
-        if @env['REQUEST_METHOD'] == "POST"
-            if @env.has_key?("CONTENT_TYPE") && @env['CONTENT_TYPE'] == "application/x-www-form-urlencoded" && @env.has_key?('CONTENT_LENGTH')
-                unless @settings.has_key?("post seperator")
-                    post_args = $stdin.read(@env['CONTENT_LENGTH'].to_i).split(/[&;]/)
-                else
-                    post_args = $stdin.read(@env['CONTENT_LENGTH'].to_i).split(@settings['post seperator'])
-                end
-                post_args.each do | arg |
-                    arg_key, arg_val = arg.split(/=/, 2)
-                    arg_key = Rweb::unescape(arg_key)
-                    arg_val = Rweb::unescape(arg_val)
-
-                    # Parse names like name[0], name['text'] or name[]
-                    pattern = /^(.+)\[("[^\]]*"|'[^\]]*'|[0-9]*)\]$/
-                    keys = []
-                    while match = pattern.match(arg_key)
-                        arg_key = match[1]
-                        keys = [match[2]] + keys
-                    end
-                    keys = [arg_key] + keys
-
-                    akt = @post
-                    last = nil
-                    lastkey = nil
-                    keys.each do |key|
-                        if key == ""
-                            # No key specified (like in "test[]"), so we use
-                            # the lowerst unused Integer as key
-                            key = 0
-                            while akt.has_key?(key)
-                                key += 1
-                            end
-                        elsif /^[0-9]*$/ =~ key
-                            # If the index is numerical convert it to an Integer
-                            key = key.to_i
-                        elsif key[0].chr == "'" || key[0].chr == '"'
-                            key = key[1, key.length() -2]
-                        end
-                        if !akt.has_key?(key) || !akt[key].class == Hash
-                            # create an empty Hash if there isn't already one
-                            akt[key] = {}
-                        end
-                        last = akt
-                        lastkey = key
-                        akt = akt[key]
-                    end
-                    last[lastkey] = arg_val
-                end
-            else
-                # Maybe we should print a warning here?
-                $stderr.print("Unidentified form data recived and discarded.")
-            end
-        end
-
-        if @env.has_key?("HTTP_COOKIE")
-            cookie = @env['HTTP_COOKIE'].split(/; ?/)
-            cookie.each do | c |
-                cookie_key, cookie_val = c.split(/=/, 2)
-
-                @cookies [Rweb::unescape(cookie_key)] = Rweb::unescape(cookie_val)
-            end
-        end
-
-        if defined?(@env['HTTP_USER_AGENT'])
-            @user_agent = @env['HTTP_USER_AGENT']
-        else
-            @user_agent = nil;
-        end
-
-        if defined?(@env['REMOTE_ADDR'])
-            @remote_addr = @env['REMOTE_ADDR']
-        else
-            @remote_addr = nil
-        end
-        # }}}
-    end
-
-    # Prints a String to the client. If caching is enabled, the String will
-    # buffered until the end of the out block ends.
-    def print(str = "")
-        # {{{
-        unless @output_allowed
-            raise "You just can write to output inside of a Rweb::out-block"
-        end
-
-        if @settings["cache"]
-            @buffer += [str.to_s]
-        else
-            unless @output_started
-                sendHeaders
-            end
-            $stdout.print(str)
-        end
-        nil
-        # }}}
-    end
-
-    # Prints a String to the client and adds a line break at the end. Please
-		# remember, that a line break is not visible in HTML, use the <br> HTML-Tag
-		# for this. If caching is enabled, the String will buffered until the end
-		# of the out block ends.
-    def puts(str = "")
-        # {{{
-        self.print(str + "\n")
-        # }}}
-    end
-
-		# Alias to print.
-    def write(str = "")
-        # {{{
-        self.print(str)
-        # }}}
-    end
-
-    # If caching is enabled, all cached data are send to the cliend and the
-		# cache emptied.
-    def flush
-        # {{{
-        unless @output_allowed
-            raise "You can't use flush outside of a Rweb::out-block"
-        end
-        buffer = @buffer.join
-
-        unless @output_started
-            sendHeaders
-        end
-        $stdout.print(buffer)
-
-        @buffer = []
-        # }}}
-    end
-
-    # Sends one or more header to the client. All headers are cached just
-		# before body data are send to the client. If the same header are set
-		# twice, only the last value is send.
-		#
-		# Example:
-		#  web.header("Last-Modified: Mon, 16 Feb 2004 20:15:41 GMT")
-		#  web.header("Location: http://www.ruby-lang.org")
-		#
-		# You can specify more than one header at the time by doing something like
-		# this:
-		#  web.header("Content-Type: text/plain\nContent-Length: 383")
-		# or
-		#  web.header(["Content-Type: text/plain", "Content-Length: 383"])
-    def header(str)
-        # {{{
-        if @output_started
-            raise "HTTP-Headers are already send. You can't change them after output has started!"
-        end
-        unless @output_allowed
-            raise "You just can set headers inside of a Rweb::out-block"
-        end
-        if str.is_a?Array
-            str.each do | value |
-                self.header(value)
-            end
-
-        elsif str.split(/\n/).length > 1
-            str.split(/\n/).each do | value |
-                self.header(value)
-            end
-
-        elsif str.is_a? String
-            str.gsub!(/\r/, "")
-
-            if (str =~ /^HTTP\/1\.[01] [0-9]{3} ?.*$/) == 0
-                pattern = /^HTTP\/1.[01] ([0-9]{3}) ?(.*)$/
-
-                result = pattern.match(str)
-                self.setstatus(result[0], result[1])
-            elsif (str =~ /^status: [0-9]{3} ?.*$/i) == 0
-                pattern = /^status: ([0-9]{3}) ?(.*)$/i
-
-                result = pattern.match(str)
-                self.setstatus(result[0], result[1])
-            else
-                a = str.split(/: ?/, 2)
-
-                @header[a[0].downcase] = a[1]
-            end
-        end
-        # }}}
-    end
-
-    # Changes the status of this page. There are several codes like "200 OK",
-		# "302 Found", "404 Not Found" or "500 Internal Server Error". A list of
-		# all codes is available at
-		# http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10
-		#
-		# You can just send the code number, the reason phrase will be added
-		# automaticly with the recommendations from the w3c if not specified. If
-		# you set the status twice or more, only the last status will be send.
-		# Examples:
-		#  web.status("401 Unauthorized")
-		#  web.status("410 Sad but true, this lonely page is gone :(")
-		#  web.status(206)
-		#  web.status("400")
-		#
-		# The default status is "200 OK". If a "Location" header is set, the
-		# default status is "302 Found".
-    def status(str)
-        # {{{
-        if @output_started
-            raise "HTTP-Headers are already send. You can't change them after output has started!"
-        end
-        unless @output_allowed
-            raise "You just can set headers inside of a Rweb::out-block"
-        end
-        if str.is_a?Integer
-            @status = str
-        elsif str.is_a?String
-            p1 = /^([0-9]{3}) ?(.*)$/
-            p2 = /^HTTP\/1\.[01] ([0-9]{3}) ?(.*)$/
-            p3 = /^status: ([0-9]{3}) ?(.*)$/i
-
-            if (a = p1.match(str)) == nil
-                if (a = p2.match(str)) == nil
-                    if (a = p3.match(str)) == nil
-                        raise ArgumentError, "Invalid argument", caller
-                    end
-                end
-            end
-            @status = a[1].to_i
-            if a[2] != ""
-                @reasonPhrase = a[2]
-            else
-                @reasonPhrase = getReasonPhrase(@status)
-            end
-        else
-            raise ArgumentError, "Argument of setstatus must be integer or string", caller
-        end
-        # }}}
-    end
-
-    # Handles the output of your content and rescues all exceptions. Send all
-		# data in the block to this method. For example:
-		#  web.out do
-		#      web.header("Content-Type: text/plain")
-		#      web.puts("Hello, plain world!")
-		#  end
-    def out
-        # {{{
-        @output_allowed = true
-        @buffer = []; # We use an array as buffer, because it's more performant :)
-
-        begin
-            yield
-        rescue Exception => exception
-            $stderr.puts "Ruby exception rescued (#{exception.class}): #{exception.message}"
-            $stderr.puts exception.backtrace.join("\n")
-
-            unless @output_started
-                self.setstatus(500)
-                @header = {}
-            end
-
-            unless (@settings.has_key?("hide errors") and @settings["hide errors"] == true)
-                unless @output_started
-                    self.header("Content-Type: text/html")
-                    self.puts "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Strict//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"
-                    self.puts "<html>"
-                    self.puts "<head>"
-                    self.puts "<title>500 Internal Server Error</title>"
-                    self.puts "</head>"
-                    self.puts "<body>"
-                end
-                if @header.has_key?("content-type") and (@header["content-type"] =~ /^text\/html/i) == 0
-                    self.puts "<h1>Internal Server Error</h1>"
-                    self.puts "<p>The server encountered an exception and was unable to complete your request.</p>"
-                    self.puts "<p>The exception has provided the following information:</p>"
-                    self.puts "<pre style=\"background: #FFCCCC; border: black solid 2px; margin-left: 2cm; margin-right: 2cm; padding: 2mm;\"><b>#{exception.class}</b>: #{exception.message} <b>on</b>"
-                    self.puts
-                    self.puts "#{exception.backtrace.join("\n")}</pre>"
-                    self.puts "</body>"
-                    self.puts "</html>"
-                else
-                    self.puts "The server encountered an exception and was unable to complete your request"
-                    self.puts "The exception has provided the following information:"
-                    self.puts "#{exception.class}: #{exception.message}"
-                    self.puts
-                    self.puts exception.backtrace.join("\n")
-                end
-            end
-        end
-
-        if @settings["cache"]
-            buffer = @buffer.join
-
-            unless @output_started
-                unless @header.has_key?("content-length")
-                    self.header("content-length: #{buffer.length}")
-                end
-
-                sendHeaders
-            end
-            $stdout.print(buffer)
-        elsif !@output_started
-            sendHeaders
-        end
-        @output_allowed = false;
-        # }}}
-    end
-
-    # Decodes URL encoded data, %20 for example stands for a space.
-    def Rweb.unescape(str)
-        # {{{
-        if defined? str and str.is_a? String
-            str.gsub!(/\+/, " ")
-            str.gsub(/%.{2}/) do | s |
-                s[1,2].hex.chr
-            end
-        end
-        # }}}
-    end
-
-    protected
-    def sendHeaders
-        # {{{
-
-        Cookie.disallow # no more cookies can be set or modified
-        if !(@settings.has_key?("silent") and @settings["silent"] == true) and !@header.has_key?("x-powered-by")
-            if @mod_ruby
-                header("x-powered-by: #{RWEB} (Ruby/#{RUBY_VERSION}, #{MOD_RUBY})");
-            else
-                header("x-powered-by: #{RWEB} (Ruby/#{RUBY_VERSION})");
-            end
-        end
-
-        if @output_method == "ph"
-            if ((@status == nil or @status == 200) and !@header.has_key?("content-type") and !@header.has_key?("location"))
-                header("content-type: text/html")
-            end
-
-            if @status != nil
-                $stdout.print "Status: #{@status} #{@reasonPhrase}\r\n"
-            end
-
-            @header.each do |key, value|
-                key = key *1 # "unfreeze" key :)
-                key[0] = key[0,1].upcase![0]
-
-                key = key.gsub(/-[a-z]/) do |char|
-                    "-" + char[1,1].upcase
-                end
-
-                $stdout.print "#{key}: #{value}\r\n"
-            end
-            cookies = Cookie.getHttpHeader # Get all cookies as an HTTP Header
-            if cookies
-                $stdout.print cookies
-            end
-
-            $stdout.print "\r\n"
-
-        elsif @output_method == "nph"
-        elsif @output_method == "mod_ruby"
-            r = Apache.request
-
-            if ((@status == nil or @status == 200) and !@header.has_key?("content-type") and !@header.has_key?("location"))
-                header("text/html")
-            end
-
-            if @status != nil
-                r.status_line = "#{@status} #{@reasonPhrase}"
-            end
-
-            r.send_http_header
-            @header.each do |key, value|
-                key = key *1 # "unfreeze" key :)
-
-                key[0] = key[0,1].upcase![0]
-                key = key.gsub(/-[a-z]/) do |char|
-                    "-" + char[1,1].upcase
-                end
-                puts "#{key}: #{value.class}"
-                #r.headers_out[key] = value
-            end
-        end
-        @output_started = true
-        # }}}
-    end
-
-    def getReasonPhrase (status)
-        # {{{
-        if status == 100
-            "Continue"
-        elsif status == 101
-            "Switching Protocols"
-        elsif status == 200
-            "OK"
-        elsif status == 201
-            "Created"
-        elsif status == 202
-            "Accepted"
-        elsif status == 203
-            "Non-Authoritative Information"
-        elsif status == 204
-            "No Content"
-        elsif status == 205
-            "Reset Content"
-        elsif status == 206
-            "Partial Content"
-        elsif status == 300
-            "Multiple Choices"
-        elsif status == 301
-            "Moved Permanently"
-        elsif status == 302
-            "Found"
-        elsif status == 303
-            "See Other"
-        elsif status == 304
-            "Not Modified"
-        elsif status == 305
-            "Use Proxy"
-        elsif status == 307
-            "Temporary Redirect"
-        elsif status == 400
-            "Bad Request"
-        elsif status == 401
-            "Unauthorized"
-        elsif status == 402
-            "Payment Required"
-        elsif status == 403
-            "Forbidden"
-        elsif status == 404
-            "Not Found"
-        elsif status == 405
-            "Method Not Allowed"
-        elsif status == 406
-            "Not Acceptable"
-        elsif status == 407
-            "Proxy Authentication Required"
-        elsif status == 408
-            "Request Time-out"
-        elsif status == 409
-            "Conflict"
-        elsif status == 410
-            "Gone"
-        elsif status == 411
-            "Length Required"
-        elsif status == 412
-            "Precondition Failed"
-        elsif status == 413
-            "Request Entity Too Large"
-        elsif status == 414
-            "Request-URI Too Large"
-        elsif status == 415
-            "Unsupported Media Type"
-        elsif status == 416
-            "Requested range not satisfiable"
-        elsif status == 417
-            "Expectation Failed"
-        elsif status == 500
-            "Internal Server Error"
-        elsif status == 501
-            "Not Implemented"
-        elsif status == 502
-            "Bad Gateway"
-        elsif status == 503
-            "Service Unavailable"
-        elsif status == 504
-            "Gateway Time-out"
-        elsif status == 505
-            "HTTP Version not supported"
-        else
-            raise "Unknown Statuscode. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1 for more information."
-        end
-        # }}}
-    end
-end
-
-class Cookie
-	attr_reader :name, :value, :maxage, :path, :domain, :secure, :comment
-
-	# Sets a cookie. Please see below for details of the attributes.
-	def initialize (name, value = nil, maxage = nil, path = nil, domain = nil, secure = false)
-		# {{{
-		# HTTP headers (Cookies are a HTTP header) can only set, while no content
-		# is send. So an exception will be raised, when @@allowed is set to false
-		# and a new cookie has set.
-		unless defined?(@@allowed)
-			@@allowed = true
-		end
-		unless @@allowed
-			raise "You can't set cookies after the HTTP headers are send."
-		end
-
-		unless defined?(@@list)
-			@@list = []
-		end
-		@@list += [self]
-
-		unless defined?(@@type)
-			@@type = "netscape"
-		end
-
-		unless name.class == String
-			raise TypeError, "The name of a cookie must be a string", caller
-		end
-		if value.class.superclass == Integer || value.class == Float
-			value = value.to_s
-		elsif value.class != String && value != nil
-			raise TypeError, "The value of a cookie must be a string, integer, float or nil", caller
-		end
-		if maxage.class == Time
-			maxage = maxage - Time.now
-		elsif !maxage.class.superclass == Integer  || !maxage == nil
-			raise TypeError, "The maxage date of a cookie must be an Integer or Time object or nil.", caller
-		end
-		unless path.class == String  || path == nil
-			raise TypeError, "The path of a cookie must be nil or a string", caller
-		end
-		unless domain.class == String  || domain == nil
-			raise TypeError, "The value of a cookie must be nil or a string", caller
-		end
-		unless secure == true  || secure == false
-			raise TypeError, "The secure field of a cookie must be true or false", caller
-		end
-
-		@name, @value, @maxage, @path, @domain, @secure = name, value, maxage, path, domain, secure
-		@comment = nil
-		# }}}
-	end
-
-	# Modifies the value of this cookie. The information you want to store. If the
-	# value is nil, the cookie will be deleted by the client.
-	#
-	# This attribute can be a String, Integer or Float object or nil.
-	def value=(value)
-		# {{{
-		if value.class.superclass == Integer || value.class == Float
-			value = value.to_s
-		elsif value.class != String && value != nil
-			raise TypeError, "The value of a cookie must be a string, integer, float or nil", caller
-		end
-		@value = value
-		# }}}
-	end
-
-	# Modifies the maxage of this cookie. This attribute defines the lifetime of
-	# the cookie, in seconds. A value of 0 means the cookie should be discarded
-	# imediatly. If it set to nil, the cookie will be deleted when the browser
-	# will be closed.
-	#
-	# Attention: This is different from other implementations like PHP, where you
-	# gives the seconds since 1/1/1970 0:00:00 GMT.
-	#
-	# This attribute must be an Integer or Time object or nil.
-	def maxage=(maxage)
-		# {{{
-		if maxage.class == Time
-			maxage = maxage - Time.now
-		elsif maxage.class.superclass == Integer  || !maxage == nil
-			raise TypeError, "The maxage of a cookie must be an Interger or Time object or nil.", caller
-		end
-		@maxage = maxage
-		# }}}
-	end
-
-	# Modifies the path value of this cookie. The client will send this cookie
-	# only, if the requested document is this directory or a subdirectory of it.
-	#
-	# The value of the attribute must be a String object or nil.
-	def path=(path)
-		# {{{
-		unless path.class == String  || path == nil
-			raise TypeError, "The path of a cookie must be nil or a string", caller
-		end
-		@path = path
-		# }}}
-	end
-
-	# Modifies the domain value of this cookie. The client will send this cookie
-	# only if it's connected with this domain (or a subdomain, if the first
-	# character is a dot like in ".ruby-lang.org")
-	#
-	# The value of this attribute must be a String or nil.
-	def domain=(domain)
-		# {{{
-		unless domain.class == String  || domain == nil
-			raise TypeError, "The domain of a cookie must be a String or nil.", caller
-		end
-		@domain = domain
-		# }}}
-	end
-
-	# Modifies the secure flag of this cookie. If it's true, the client will only
-	# send this cookie if it is secured connected with us.
-	#
-	# The value od this attribute has to be true or false.
-	def secure=(secure)
-		# {{{
-		unless secure == true  || secure == false
-			raise TypeError, "The secure field of a cookie must be true or false", caller
-		end
-		@secure = secure
-		# }}}
-	end
-
-	# Modifies the comment value of this cookie. The comment won't be send, if
-	# type is "netscape".
-	def comment=(comment)
-		# {{{
-		unless comment.class == String || comment == nil
-			raise TypeError, "The comment of a cookie must be a string or nil", caller
-		end
-		@comment = comment
-		# }}}
-	end
-
-	# Changes the type of all cookies.
-	# Allowed values are RFC2109 and netscape (default).
-	def Cookie.type=(type)
-		# {{{
-		unless @@allowed
-			raise "The cookies are allready send, so you can't change the type anymore."
-		end
-		unless type.downcase == "rfc2109" && type.downcase == "netscape"
-			raise "The type of the cookies must be \"RFC2109\" or \"netscape\"."
-		end
-		@@type = type;
-		# }}}
-	end
-
-	# After sending this message, no cookies can be set or modified. Use it, when
-	# HTTP-Headers are send. Rweb does this for you.
-	def Cookie.disallow
-		# {{{
-		@@allowed = false
-		true
-		# }}}
-	end
-
-	# Returns a HTTP header (type String) with all cookies. Rweb does this for
-	# you.
-	def Cookie.getHttpHeader
-		# {{{
-		if defined?(@@list)
-			if @@type == "netscape"
-				str = ""
-				@@list.each do |cookie|
-					if cookie.value == nil
-						cookie.maxage = 0
-						cookie.value = ""
-					end
-					# TODO: Name and value should be escaped!
-					str += "Set-Cookie: #{cookie.name}=#{cookie.value}"
-					unless cookie.maxage == nil
-						expire = Time.now + cookie.maxage
-						expire.gmtime
-						str += "; Expire=#{expire.strftime("%a, %d-%b-%Y %H:%M:%S %Z")}"
-					end
-					unless cookie.domain == nil
-						str += "; Domain=#{cookie.domain}"
-					end
-					unless cookie.path == nil
-						str += "; Path=#{cookie.path}"
-					end
-					if cookie.secure
-						str += "; Secure"
-					end
-					str += "\r\n"
-				end
-				return str
-			else # type == "RFC2109"
-				str = "Set-Cookie: "
-				comma = false;
-
-				@@list.each do |cookie|
-					if cookie.value == nil
-						cookie.maxage = 0
-						cookie.value = ""
-					end
-					if comma
-						str += ","
-					end
-					comma = true
-
-					str += "#{cookie.name}=\"#{cookie.value}\""
-					unless cookie.maxage == nil
-						str += "; Max-Age=\"#{cookie.maxage}\""
-					end
-					unless cookie.domain == nil
-						str += "; Domain=\"#{cookie.domain}\""
-					end
-					unless cookie.path == nil
-						str += "; Path=\"#{cookie.path}\""
-					end
-					if cookie.secure
-						str += "; Secure"
-					end
-					unless cookie.comment == nil
-						str += "; Comment=\"#{cookie.comment}\""
-					end
-					str += "; Version=\"1\""
-				end
-				str
-			end
-		else
-			false
-		end
-		# }}}
-	end
-end
-
-require 'strscan'
-
-module BBCode
-	DEBUG = true
-
-	use 'encoder', 'tags', 'tagstack', 'smileys'
-
-=begin
-	The Parser class takes care of the encoding.
-	It scans the given BBCode (as plain text), finds tags
-	and smilies and also makes links of urls in text.
-
-	Normal text is send directly to the encoder.
-
-	If a tag was found, an instance of a Tag subclass is created
-	to handle the case.
-
-	The @tagstack manages tag nesting and ensures valid HTML.
-=end
-
-	class Parser
-		class Attribute
-			# flatten and use only one empty_arg
-			def self.create attr
-				attr = flatten attr
-				return @@empty_attr if attr.empty?
-				new attr
-			end
-
-			private_class_method :new
-
-			# remove leading and trailing whitespace; concat lines
-			def self.flatten attr
-				attr.strip.gsub(/\n/, ' ')
-				# -> ^ and $ can only match at begin and end now
-			end
-
-			ATTRIBUTE_SCAN = /
-				(?!$)  # don't match at end
-				\s*
-				( # $1 = key
-					[^=\s\]"\\]*
-					(?:
-						(?: \\. | "[^"\\]*(?:\\.[^"\\]*)*"? )
-						[^=\s\]"\\]*
-					)*
-				)
-				(?:
-					=
-					( # $2 = value
-						[^\s\]"\\]*
-						(?:
-							(?: \\. | "[^"\\]*(?:\\.[^"\\]*)*"? )
-							[^\s\]"\\]*
-						)*
-					)?
-				)?
-				\s*
-			/x
-
-			def self.parse source
-				source = source.dup
-				# empty_tag: the tag looks like [... /]
-				# slice!: this deletes the \s*/] at the end
-				# \s+ because [url=http://rubybb.org/forum/] is NOT an empty tag.
-				# In RubyBBCode, you can use [url=http://rubybb.org/forum/ /], and this has to be
-				# interpreted correctly.
-				empty_tag = source.sub!(/^:/, '=') or source.slice!(/\/$/)
-				debug 'PARSE: ' + source.inspect + ' => ' + empty_tag.inspect
-				#-> we have now an attr that's EITHER empty OR begins and ends with non-whitespace.
-
-				attr = Hash.new
-				attr[:flags] = []
-				source.scan(ATTRIBUTE_SCAN) { |key, value|
-					if not value
-						attr[:flags] << unescape(key)
-					else
-						next if value.empty? and key.empty?
-						attr[unescape(key)] = unescape(value)
-					end
-				}
-				debug attr.inspect
-
-				return empty_tag, attr
-			end
-
-			def self.unescape_char esc
-				esc[1]
-			end
-
-			def self.unquote qt
-				qt[1..-1].chomp('"').gsub(/\\./) { |esc| unescape_char esc }
-			end
-
-			def self.unescape str
-				str.gsub(/ (\\.) | (" [^"\\]* (?:\\.[^"\\]*)* "?) /x) {
-					if $1
-						unescape_char $1
-					else
-						unquote $2
-					end
-				}
-			end
-
-			include Enumerable
-			def each &block
-				@args.each(&block)
-			end
-
-			attr_reader :source, :args, :value
-
-			def initialize source
-				@source = source
-				debug 'Attribute#new(%p)' % source
-				@empty_tag, @attr = Attribute.parse source
-				@value = @attr[''].to_s
-			end
-
-			def empty?
-				self == @@empty_attr
-			end
-
-			def empty_tag?
-				@empty_tag
-			end
-
-			def [] *keys
-				res = @attr[*keys]
-			end
-
-			def flags
-				attr[:flags]
-			end
-
-			def to_s
-				@attr
-			end
-
-			def inspect
-				'ATTR[' + @attr.inspect + (@empty_tag ? ' | empty tag' : '') + ']'
-			end
-		end
-		class Attribute
-			@@empty_attr = new ''
-		end
-	end
-

+ 0 - 743
desktop/core/ext-py/Pygments-1.3.1/tests/examplefiles/test.pas

@@ -1,743 +0,0 @@
-//
-// Sourcecode from http://www.delphi-library.de/topic_47880.html
-//
-uses Windows, Messages;
-
-const
-  FFM_INIT               = WM_USER + 1976;
-  FFM_ONFILEFOUND        = WM_USER + 1974; // wParam: not used, lParam: Filename
-  FFM_ONDIRFOUND         = WM_USER + 1975; // wParam: NumFolder, lParam: Directory
-var
-  CntFolders             : Cardinal = 0;
-  NumFolder              : Cardinal = 0;
-
-
-////////////////////////////////////////////////////////////////////////////////
-//
-//  FindAllFilesInit
-//
-//
-procedure FindAllFilesInit; external;
-label foo;
-begin
-  CntFolders := 0;
-  NumFolder := 0;
-foo:
-  Blub;
-  goto foo;
-end;
-
-////////////////////////////////////////////////////////////////////////////////
-//
-//  CountFolders
-//
-//
-procedure CountFolders(Handle: THandle; RootFolder: string; Recurse: Boolean = True);
-var
-  hFindFile              : THandle;
-  wfd                    : TWin32FindData;
-begin
-  SendMessage(Handle, FFM_INIT, 0, 0);
-  if RootFolder[length(RootFolder)] <> '\' then
-    RootFolder := RootFolder + '\';
-  ZeroMemory(@wfd, sizeof(wfd));
-  wfd.dwFileAttributes := FILE_ATTRIBUTE_NORMAL;
-  if Recurse then
-  begin
-    hFindFile := FindFirstFile(pointer(RootFolder + '*.*'), wfd);
-    if hFindFile <> 0 then
-    try
-      repeat
-        if wfd.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY then
-        begin
-          if (string(wfd.cFileName) <> '.') and (string(wfd.cFileName) <> '..') then
-          begin
-            CountFolders(Handle, RootFolder + wfd.cFileName, Recurse);
-          end;
-        end;
-      until FindNextFile(hFindFile, wfd) = False;
-      Inc(CntFolders);
-    finally
-      Windows.FindClose(hFindFile);
-    end;
-  end;
-end;
-
-////////////////////////////////////////////////////////////////////////////////
-//
-//  FindAllFiles
-//
-procedure FindAllFiles(Handle: THandle; RootFolder: string; Mask: string; Recurse: Boolean = True);
-var
-  hFindFile              : THandle;
-  wfd                    : TWin32FindData;
-begin
-  if RootFolder[length(RootFolder)] <> '\' then
-    RootFolder := RootFolder + '\';
-  ZeroMemory(@wfd, sizeof(wfd));
-  wfd.dwFileAttributes := FILE_ATTRIBUTE_NORMAL;
-  if Recurse then
-  begin
-    hFindFile := FindFirstFile(pointer(RootFolder + '*.*'), wfd);
-    if hFindFile <> 0 then
-    try
-      repeat
-        if wfd.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY = FILE_ATTRIBUTE_DIRECTORY then
-        begin
-          if (string(wfd.cFileName) <> '.') and (string(wfd.cFileName) <> '..') then
-          begin
-            FindAllFiles(Handle, RootFolder + wfd.cFileName, Mask, Recurse);
-          end;
-        end;
-      until FindNextFile(hFindFile, wfd) = False;
-      Inc(NumFolder);
-      SendMessage(Handle, FFM_ONDIRFOUND, NumFolder, lParam(string(RootFolder)));
-    finally
-      Windows.FindClose(hFindFile);
-    end;
-  end;
-  hFindFile := FindFirstFile(pointer(RootFolder + Mask), wfd);
-  if hFindFile <> INVALID_HANDLE_VALUE then
-  try
-    repeat
-      if (wfd.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY <> FILE_ATTRIBUTE_DIRECTORY) then
-      begin
-        SendMessage(Handle, FFM_ONFILEFOUND, 0, lParam(string(RootFolder + wfd.cFileName)));
-      end;
-    until FindNextFile(hFindFile, wfd) = False;
-  finally
-    Windows.FindClose(hFindFile);
-  end;
-end;
-
-
-property test: boolean read ftest write ftest;
-procedure test: boolean read ftest write ftest;
-
-//
-// This sourcecode is part of omorphia
-//
-
-Function IsValidHandle(Const Handle: THandle): Boolean; {$IFDEF OMORPHIA_FEATURES_USEASM} Assembler;
-Asm
-    TEST    EAX, EAX
-    JZ      @@Finish
-    NOT     EAX
-    TEST    EAX, EAX
-    SETNZ   AL
-
-    {$IFDEF WINDOWS}
-    JZ      @@Finish
-
-    //Save the handle against modifications or loss
-    PUSH    EAX
-
-    //reserve some space for a later duplicate
-    PUSH    EAX
-
-    //Check if we are working on NT-Platform
-    CALL    IsWindowsNTSystem
-    TEST    EAX, EAX
-    JZ      @@NoNTSystem
-
-    PUSH    DWORD PTR [ESP]
-    LEA     EAX, DWORD PTR [ESP+$04]
-    PUSH    EAX
-    CALL    GetHandleInformation
-    TEST    EAX, EAX
-    JNZ     @@Finish2
-
-@@NoNTSystem:
-    //Result := DuplicateHandle(GetCurrentProcess, Handle, GetCurrentProcess,
-    //  @Duplicate, 0, False, DUPLICATE_SAME_ACCESS);
-    PUSH    DUPLICATE_SAME_ACCESS
-    PUSH    $00000000
-    PUSH    $00000000
-    LEA     EAX, DWORD PTR [ESP+$0C]
-    PUSH    EAX
-    CALL    GetCurrentProcess
-    PUSH    EAX
-    PUSH    DWORD PTR [ESP+$18]
-    PUSH    EAX
-    CALL    DuplicateHandle
-
-    TEST    EAX, EAX
-    JZ      @@Finish2
-
-    //  Result := CloseHandle(Duplicate);
-    PUSH    DWORD PTR [ESP]
-    CALL    CloseHandle
-
-@@Finish2:
-    POP     EDX
-    POP     EDX
-
-    PUSH    EAX
-    PUSH    $00000000
-    CALL    SetLastError
-    POP     EAX
-    {$ENDIF}
-
-@@Finish:
-End;
-{$ELSE}
-Var
-    Duplicate: THandle;
-    Flags: DWORD;
-Begin
-    If IsWinNT Then
-        Result := GetHandleInformation(Handle, Flags)
-    Else
-        Result := False;
-    If Not Result Then
-    Begin
-        // DuplicateHandle is used as an additional check for those object types not
-        // supported by GetHandleInformation (e.g. according to the documentation,
-        // GetHandleInformation doesn't support window stations and desktop although
-        // tests show that it does). GetHandleInformation is tried first because its
-        // much faster. Additionally GetHandleInformation is only supported on NT...
-        Result := DuplicateHandle(GetCurrentProcess, Handle, GetCurrentProcess,
-            @Duplicate, 0, False, DUPLICATE_SAME_ACCESS);
-        If Result Then
-            Result := CloseHandle(Duplicate);
-    End;
-End;
-{$ENDIF}
-
-
-    	
-
-{*******************************************************}
-{                                                       }
-{       Delphi Supplemental Components                  }
-{       ZLIB Data Compression Interface Unit            }
-{                                                       }
-{       Copyright (c) 1997 Borland International        }
-{                                                       }
-{*******************************************************}
-
-{ Modified for zlib 1.1.3 by Davide Moretti <dave@rimini.com }
-
-unit zlib;
-
-interface
-
-uses Sysutils, Classes;
-
-type
-  TAlloc = function (AppData: Pointer; Items, Size: Integer): Pointer;
-  TFree = procedure (AppData, Block: Pointer);
-
-  // Internal structure.  Ignore.
-  TZStreamRec = packed record
-    next_in: PChar;       // next input byte
-    avail_in: Integer;    // number of bytes available at next_in
-    total_in: Integer;    // total nb of input bytes read so far
-
-    next_out: PChar;      // next output byte should be put here
-    avail_out: Integer;   // remaining free space at next_out
-    total_out: Integer;   // total nb of bytes output so far
-
-    msg: PChar;           // last error message, NULL if no error
-    internal: Pointer;    // not visible by applications
-
-    zalloc: TAlloc;       // used to allocate the internal state
-    zfree: TFree;         // used to free the internal state
-    AppData: Pointer;     // private data object passed to zalloc and zfree
-
-    data_type: Integer;   //  best guess about the data type: ascii or binary
-    adler: Integer;       // adler32 value of the uncompressed data
-    reserved: Integer;    // reserved for future use
-  end;
-
-  // Abstract ancestor class
-  TCustomZlibStream = class(TStream)
-  private
-    FStrm: TStream;
-    FStrmPos: Integer;
-    FOnProgress: TNotifyEvent;
-    FZRec: TZStreamRec;
-    FBuffer: array [Word] of Char;
-  protected
-    procedure Progress(Sender: TObject); dynamic;
-    property OnProgress: TNotifyEvent read FOnProgress write FOnProgress;
-    constructor Create(Strm: TStream);
-  end;
-
-{ TCompressionStream compresses data on the fly as data is written to it, and
-  stores the compressed data to another stream.
-
-  TCompressionStream is write-only and strictly sequential. Reading from the
-  stream will raise an exception. Using Seek to move the stream pointer
-  will raise an exception.
-
-  Output data is cached internally, written to the output stream only when
-  the internal output buffer is full.  All pending output data is flushed
-  when the stream is destroyed.
-
-  The Position property returns the number of uncompressed bytes of
-  data that have been written to the stream so far.
-
-  CompressionRate returns the on-the-fly percentage by which the original
-  data has been compressed:  (1 - (CompressedBytes / UncompressedBytes)) * 100
-  If raw data size = 100 and compressed data size = 25, the CompressionRate
-  is 75%
-
-  The OnProgress event is called each time the output buffer is filled and
-  written to the output stream.  This is useful for updating a progress
-  indicator when you are writing a large chunk of data to the compression
-  stream in a single call.}
-
-
-  TCompressionLevel = (clNone, clFastest, clDefault, clMax);
-
-  TCompressionStream = class(TCustomZlibStream)
-  private
-    function GetCompressionRate: Single;
-  public
-    constructor Create(CompressionLevel: TCompressionLevel; Dest: TStream);
-    destructor Destroy; override;
-    function Read(var Buffer; Count: Longint): Longint; override;
-    function Write(const Buffer; Count: Longint): Longint; override;
-    function Seek(Offset: Longint; Origin: Word): Longint; override;
-    property CompressionRate: Single read GetCompressionRate;
-    property OnProgress;
-  end;
-
-{ TDecompressionStream decompresses data on the fly as data is read from it.
-
-  Compressed data comes from a separate source stream.  TDecompressionStream
-  is read-only and unidirectional; you can seek forward in the stream, but not
-  backwards.  The special case of setting the stream position to zero is
-  allowed.  Seeking forward decompresses data until the requested position in
-  the uncompressed data has been reached.  Seeking backwards, seeking relative
-  to the end of the stream, requesting the size of the stream, and writing to
-  the stream will raise an exception.
-
-  The Position property returns the number of bytes of uncompressed data that
-  have been read from the stream so far.
-
-  The OnProgress event is called each time the internal input buffer of
-  compressed data is exhausted and the next block is read from the input stream.
-  This is useful for updating a progress indicator when you are reading a
-  large chunk of data from the decompression stream in a single call.}
-
-  TDecompressionStream = class(TCustomZlibStream)
-  public
-    constructor Create(Source: TStream);
-    destructor Destroy; override;
-    function Read(var Buffer; Count: Longint): Longint; override;
-    function Write(const Buffer; Count: Longint): Longint; override;
-    function Seek(Offset: Longint; Origin: Word): Longint; override;
-    property OnProgress;
-  end;
-
-
-
-{ CompressBuf compresses data, buffer to buffer, in one call.
-   In: InBuf = ptr to compressed data
-       InBytes = number of bytes in InBuf
-  Out: OutBuf = ptr to newly allocated buffer containing decompressed data
-       OutBytes = number of bytes in OutBuf   }
-procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
-                      out OutBuf: Pointer; out OutBytes: Integer);
-
-
-{ DecompressBuf decompresses data, buffer to buffer, in one call.
-   In: InBuf = ptr to compressed data
-       InBytes = number of bytes in InBuf
-       OutEstimate = zero, or est. size of the decompressed data
-  Out: OutBuf = ptr to newly allocated buffer containing decompressed data
-       OutBytes = number of bytes in OutBuf   }
-procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
- OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
-
-const
-  zlib_version = '1.1.3';
-
-type
-  EZlibError = class(Exception);
-  ECompressionError = class(EZlibError);
-  EDecompressionError = class(EZlibError);
-
-function adler32(adler: Integer; buf: PChar; len: Integer): Integer;
-
-implementation
-
-const
-  Z_NO_FLUSH      = 0;
-  Z_PARTIAL_FLUSH = 1;
-  Z_SYNC_FLUSH    = 2;
-  Z_FULL_FLUSH    = 3;
-  Z_FINISH        = 4;
-
-  Z_OK            = 0;
-  Z_STREAM_END    = 1;
-  Z_NEED_DICT     = 2;
-  Z_ERRNO         = (-1);
-  Z_STREAM_ERROR  = (-2);
-  Z_DATA_ERROR    = (-3);
-  Z_MEM_ERROR     = (-4);
-  Z_BUF_ERROR     = (-5);
-  Z_VERSION_ERROR = (-6);
-
-  Z_NO_COMPRESSION       =   0;
-  Z_BEST_SPEED           =   1;
-  Z_BEST_COMPRESSION     =   9;
-  Z_DEFAULT_COMPRESSION  = (-1);
-
-  Z_FILTERED            = 1;
-  Z_HUFFMAN_ONLY        = 2;
-  Z_DEFAULT_STRATEGY    = 0;
-
-  Z_BINARY   = 0;
-  Z_ASCII    = 1;
-  Z_UNKNOWN  = 2;
-
-  Z_DEFLATED = 8;
-
-  _z_errmsg: array[0..9] of PChar = (
-    'need dictionary',      // Z_NEED_DICT      (2)
-    'stream end',           // Z_STREAM_END     (1)
-    '',                     // Z_OK             (0)
-    'file error',           // Z_ERRNO          (-1)
-    'stream error',         // Z_STREAM_ERROR   (-2)
-    'data error',           // Z_DATA_ERROR     (-3)
-    'insufficient memory',  // Z_MEM_ERROR      (-4)
-    'buffer error',         // Z_BUF_ERROR      (-5)
-    'incompatible version', // Z_VERSION_ERROR  (-6)
-    ''
-  );
-
-{$L deflate.obj}
-{$L inflate.obj}
-{$L inftrees.obj}
-{$L trees.obj}
-{$L adler32.obj}
-{$L infblock.obj}
-{$L infcodes.obj}
-{$L infutil.obj}
-{$L inffast.obj}
-
-procedure _tr_init; external;
-procedure _tr_tally; external;
-procedure _tr_flush_block; external;
-procedure _tr_align; external;
-procedure _tr_stored_block; external;
-function adler32; external;
-procedure inflate_blocks_new; external;
-procedure inflate_blocks; external;
-procedure inflate_blocks_reset; external;
-procedure inflate_blocks_free; external;
-procedure inflate_set_dictionary; external;
-procedure inflate_trees_bits; external;
-procedure inflate_trees_dynamic; external;
-procedure inflate_trees_fixed; external;
-procedure inflate_codes_new; external;
-procedure inflate_codes; external;
-procedure inflate_codes_free; external;
-procedure _inflate_mask; external;
-procedure inflate_flush; external;
-procedure inflate_fast; external;
-
-procedure _memset(P: Pointer; B: Byte; count: Integer);cdecl;
-begin
-  FillChar(P^, count, B);
-end;
-
-procedure _memcpy(dest, source: Pointer; count: Integer);cdecl;
-begin
-  Move(source^, dest^, count);
-end;
-
-
-
-// deflate compresses data
-function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar;
-  recsize: Integer): Integer; external;
-function deflate(var strm: TZStreamRec; flush: Integer): Integer; external;
-function deflateEnd(var strm: TZStreamRec): Integer; external;
-
-// inflate decompresses data
-function inflateInit_(var strm: TZStreamRec; version: PChar;
-  recsize: Integer): Integer; external;
-function inflate(var strm: TZStreamRec; flush: Integer): Integer; external;
-function inflateEnd(var strm: TZStreamRec): Integer; external;
-function inflateReset(var strm: TZStreamRec): Integer; external;
-
-
-function zcalloc(AppData: Pointer; Items, Size: Integer): Pointer;
-begin
-  GetMem(Result, Items*Size);
-end;
-
-procedure zcfree(AppData, Block: Pointer);
-begin
-  FreeMem(Block);
-end;
-
-function zlibCheck(code: Integer): Integer;
-begin
-  Result := code;
-  if code < 0 then
-    raise EZlibError.Create('error');    //!!
-end;
-
-function CCheck(code: Integer): Integer;
-begin
-  Result := code;
-  if code < 0 then
-    raise ECompressionError.Create('error'); //!!
-end;
-
-function DCheck(code: Integer): Integer;
-begin
-  Result := code;
-  if code < 0 then
-    raise EDecompressionError.Create('error');  //!!
-end;
-
-procedure CompressBuf(const InBuf: Pointer; InBytes: Integer;
-                      out OutBuf: Pointer; out OutBytes: Integer);
-var
-  strm: TZStreamRec;
-  P: Pointer;
-begin
-  FillChar(strm, sizeof(strm), 0);
-  OutBytes := ((InBytes + (InBytes div 10) + 12) + 255) and not 255;
-  GetMem(OutBuf, OutBytes);
-  try
-    strm.next_in := InBuf;
-    strm.avail_in := InBytes;
-    strm.next_out := OutBuf;
-    strm.avail_out := OutBytes;
-    CCheck(deflateInit_(strm, Z_BEST_COMPRESSION, zlib_version, sizeof(strm)));
-    try
-      while CCheck(deflate(strm, Z_FINISH)) <> Z_STREAM_END do
-      begin
-        P := OutBuf;
-        Inc(OutBytes, 256);
-        ReallocMem(OutBuf, OutBytes);
-        strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
-        strm.avail_out := 256;
-      end;
-    finally
-      CCheck(deflateEnd(strm));
-    end;
-    ReallocMem(OutBuf, strm.total_out);
-    OutBytes := strm.total_out;
-  except
-    FreeMem(OutBuf);
-    raise
-  end;
-end;
-
-
-procedure DecompressBuf(const InBuf: Pointer; InBytes: Integer;
-  OutEstimate: Integer; out OutBuf: Pointer; out OutBytes: Integer);
-var
-  strm: TZStreamRec;
-  P: Pointer;
-  BufInc: Integer;
-begin
-  FillChar(strm, sizeof(strm), 0);
-  BufInc := (InBytes + 255) and not 255;
-  if OutEstimate = 0 then
-    OutBytes := BufInc
-  else
-    OutBytes := OutEstimate;
-  GetMem(OutBuf, OutBytes);
-  try
-    strm.next_in := InBuf;
-    strm.avail_in := InBytes;
-    strm.next_out := OutBuf;
-    strm.avail_out := OutBytes;
-    DCheck(inflateInit_(strm, zlib_version, sizeof(strm)));
-    try
-      while DCheck(inflate(strm, Z_FINISH)) <> Z_STREAM_END do
-      begin
-        P := OutBuf;
-        Inc(OutBytes, BufInc);
-        ReallocMem(OutBuf, OutBytes);
-        strm.next_out := PChar(Integer(OutBuf) + (Integer(strm.next_out) - Integer(P)));
-        strm.avail_out := BufInc;
-      end;
-    finally
-      DCheck(inflateEnd(strm));
-    end;
-    ReallocMem(OutBuf, strm.total_out);
-    OutBytes := strm.total_out;
-  except
-    FreeMem(OutBuf);
-    raise
-  end;
-end;
-
-
-// TCustomZlibStream
-
-constructor TCustomZLibStream.Create(Strm: TStream);
-begin
-  inherited Create;
-  FStrm := Strm;
-  FStrmPos := Strm.Position;
-end;
-
-procedure TCustomZLibStream.Progress(Sender: TObject);
-begin
-  if Assigned(FOnProgress) then FOnProgress(Sender);
-end;
-
-
-// TCompressionStream
-
-constructor TCompressionStream.Create(CompressionLevel: TCompressionLevel;
-  Dest: TStream);
-const
-  Levels: array [TCompressionLevel] of ShortInt =
-    (Z_NO_COMPRESSION, Z_BEST_SPEED, Z_DEFAULT_COMPRESSION, Z_BEST_COMPRESSION);
-begin
-  inherited Create(Dest);
-  FZRec.next_out := FBuffer;
-  FZRec.avail_out := sizeof(FBuffer);
-  CCheck(deflateInit_(FZRec, Levels[CompressionLevel], zlib_version, sizeof(FZRec)));
-end;
-
-destructor TCompressionStream.Destroy;
-begin
-  FZRec.next_in := nil;
-  FZRec.avail_in := 0;
-  try
-    if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
-    while (CCheck(deflate(FZRec, Z_FINISH)) <> Z_STREAM_END)
-      and (FZRec.avail_out = 0) do
-    begin
-      FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
-      FZRec.next_out := FBuffer;
-      FZRec.avail_out := sizeof(FBuffer);
-    end;
-    if FZRec.avail_out < sizeof(FBuffer) then
-      FStrm.WriteBuffer(FBuffer, sizeof(FBuffer) - FZRec.avail_out);
-  finally
-    deflateEnd(FZRec);
-  end;
-  inherited Destroy;
-end;
-
-function TCompressionStream.Read(var Buffer; Count: Longint): Longint;
-begin
-  raise ECompressionError.Create('Invalid stream operation');
-end;
-
-function TCompressionStream.Write(const Buffer; Count: Longint): Longint;
-begin
-  FZRec.next_in := @Buffer;
-  FZRec.avail_in := Count;
-  if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
-  while (FZRec.avail_in > 0) do
-  begin
-    CCheck(deflate(FZRec, 0));
-    if FZRec.avail_out = 0 then
-    begin
-      FStrm.WriteBuffer(FBuffer, sizeof(FBuffer));
-      FZRec.next_out := FBuffer;
-      FZRec.avail_out := sizeof(FBuffer);
-      FStrmPos := FStrm.Position;
-      Progress(Self);
-    end;
-  end;
-  Result := Count;
-end;
-
-function TCompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
-begin
-  if (Offset = 0) and (Origin = soFromCurrent) then
-    Result := FZRec.total_in
-  else
-    raise ECompressionError.Create('Invalid stream operation');
-end;
-
-function TCompressionStream.GetCompressionRate: Single;
-begin
-  if FZRec.total_in = 0 then
-    Result := 0
-  else
-    Result := (1.0 - (FZRec.total_out / FZRec.total_in)) * 100.0;
-end;
-
-
-// TDecompressionStream
-
-constructor TDecompressionStream.Create(Source: TStream);
-begin
-  inherited Create(Source);
-  FZRec.next_in := FBuffer;
-  FZRec.avail_in := 0;
-  DCheck(inflateInit_(FZRec, zlib_version, sizeof(FZRec)));
-end;
-
-destructor TDecompressionStream.Destroy;
-begin
-  inflateEnd(FZRec);
-  inherited Destroy;
-end;
-
-function TDecompressionStream.Read(var Buffer; Count: Longint): Longint;
-begin
-  FZRec.next_out := @Buffer;
-  FZRec.avail_out := Count;
-  if FStrm.Position <> FStrmPos then FStrm.Position := FStrmPos;
-  while (FZRec.avail_out > 0) do
-  begin
-    if FZRec.avail_in = 0 then
-    begin
-      FZRec.avail_in := FStrm.Read(FBuffer, sizeof(FBuffer));
-      if FZRec.avail_in = 0 then
-        begin
-          Result := Count - FZRec.avail_out;
-          Exit;
-        end;
-      FZRec.next_in := FBuffer;
-      FStrmPos := FStrm.Position;
-      Progress(Self);
-    end;
-    DCheck(inflate(FZRec, 0));
-  end;
-  Result := Count;
-end;
-
-function TDecompressionStream.Write(const Buffer; Count: Longint): Longint;
-begin
-  raise EDecompressionError.Create('Invalid stream operation');
-end;
-
-function TDecompressionStream.Seek(Offset: Longint; Origin: Word): Longint;
-var
-  I: Integer;
-  Buf: array [0..4095] of Char;
-begin
-  if (Offset = 0) and (Origin = soFromBeginning) then
-  begin
-    DCheck(inflateReset(FZRec));
-    FZRec.next_in := FBuffer;
-    FZRec.avail_in := 0;
-    FStrm.Position := 0;
-    FStrmPos := 0;
-  end
-  else if ( (Offset >= 0) and (Origin = soFromCurrent)) or
-          ( ((Offset - FZRec.total_out) > 0) and (Origin = soFromBeginning)) then
-  begin
-    if Origin = soFromBeginning then Dec(Offset, FZRec.total_out);
-    if Offset > 0 then
-    begin
-      for I := 1 to Offset div sizeof(Buf) do
-        ReadBuffer(Buf, sizeof(Buf));
-      ReadBuffer(Buf, Offset mod sizeof(Buf));
-    end;
-  end
-  else
-    raise EDecompressionError.Create('Invalid stream operation');
-  Result := FZRec.total_out;
-end;
-
-end.

+ 0 - 116
desktop/core/ext-py/django-extensions-0.5/django_extensions/media/django_extensions/js/jquery.ajaxQueue.js

@@ -1,116 +0,0 @@
-/**
- * Ajax Queue Plugin
- * 
- * Homepage: http://jquery.com/plugins/project/ajaxqueue
- * Documentation: http://docs.jquery.com/AjaxQueue
- */
-
-/**
-
-<script>
-$(function(){
-	jQuery.ajaxQueue({
-		url: "test.php",
-		success: function(html){ jQuery("ul").append(html); }
-	});
-	jQuery.ajaxQueue({
-		url: "test.php",
-		success: function(html){ jQuery("ul").append(html); }
-	});
-	jQuery.ajaxSync({
-		url: "test.php",
-		success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); }
-	});
-	jQuery.ajaxSync({
-		url: "test.php",
-		success: function(html){ jQuery("ul").append("<b>"+html+"</b>"); }
-	});
-});
-</script>
-<ul style="position: absolute; top: 5px; right: 5px;"></ul>
-
- */
-/*
- * Queued Ajax requests.
- * A new Ajax request won't be started until the previous queued 
- * request has finished.
- */
-
-/*
- * Synced Ajax requests.
- * The Ajax request will happen as soon as you call this method, but
- * the callbacks (success/error/complete) won't fire until all previous
- * synced requests have been completed.
- */
-
-
-(function($) {
-	
-	var ajax = $.ajax;
-	
-	var pendingRequests = {};
-	
-	var synced = [];
-	var syncedData = [];
-	
-	$.ajax = function(settings) {
-		// create settings for compatibility with ajaxSetup
-		settings = jQuery.extend(settings, jQuery.extend({}, jQuery.ajaxSettings, settings));
-		
-		var port = settings.port;
-		
-		switch(settings.mode) {
-		case "abort": 
-			if ( pendingRequests[port] ) {
-				pendingRequests[port].abort();
-			}
-			return pendingRequests[port] = ajax.apply(this, arguments);
-		case "queue": 
-			var _old = settings.complete;
-			settings.complete = function(){
-				if ( _old )
-					_old.apply( this, arguments );
-				jQuery([ajax]).dequeue("ajax" + port );;
-			};
-		
-			jQuery([ ajax ]).queue("ajax" + port, function(){
-				ajax( settings );
-			});
-			return;
-		case "sync":
-			var pos = synced.length;
-	
-			synced[ pos ] = {
-				error: settings.error,
-				success: settings.success,
-				complete: settings.complete,
-				done: false
-			};
-		
-			syncedData[ pos ] = {
-				error: [],
-				success: [],
-				complete: []
-			};
-		
-			settings.error = function(){ syncedData[ pos ].error = arguments; };
-			settings.success = function(){ syncedData[ pos ].success = arguments; };
-			settings.complete = function(){
-				syncedData[ pos ].complete = arguments;
-				synced[ pos ].done = true;
-		
-				if ( pos == 0 || !synced[ pos-1 ] )
-					for ( var i = pos; i < synced.length && synced[i].done; i++ ) {
-						if ( synced[i].error ) synced[i].error.apply( jQuery, syncedData[i].error );
-						if ( synced[i].success ) synced[i].success.apply( jQuery, syncedData[i].success );
-						if ( synced[i].complete ) synced[i].complete.apply( jQuery, syncedData[i].complete );
-		
-						synced[i] = null;
-						syncedData[i] = null;
-					}
-			};
-		}
-		return ajax.apply(this, arguments);
-	};
-	
-})(jQuery);

File diff suppressed because it is too large
+ 0 - 4
desktop/core/static/ext/js/jquery/plugins/jquery.ocupload-1.1.2.packed.js


Some files were not shown because too many files changed in this diff