code
stringlengths
1
1.72M
language
stringclasses
1 value
#!/usr/bin/env python """Communicating sequential processes, in Python. When using CSP Python as a DSL, this module will normally be imported via the statement 'from csp.csp import *' and should not be imported directly. Copyright (C) Sarah Mount, 2009-10. This program is free software; you can redistribute it and/...
Python
#!/usr/bin/env python """ Builtin guard types. For builtin processes see csp.builtins. Copyright (C) Sarah Mount, 2010. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the Licen...
Python
#!/usr/bin/env python """Design pattern support for python-csp. Copyright (C) Sarah Mount, 2010. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option)...
Python
#!/usr/bin/env python """ Simple representation of CSP models, with graphviz and FDR2 output. Copyright (C) Sarah Mount, 2010. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of th...
Python
#!/usr/bin/env python """ Tracer for python-csp, intended for generating models of a python-csp program, including process graphs, CSP traces and FDR2 models. Some source from pycallgraph.py is used here. pycallgraph is published under the GNU General Public License. U{http://pycallgraph.slowchop.com/} (C) Gerald Ka...
Python
#!/bin/env python """ Digital signal processing for python-csp. Copyright (C) Sarah Mount, 2009. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option)...
Python
#!/usr/bin/env python """Communicating sequential processes, in Python. When using CSP Python as a DSL, this module will normally be imported via the statement 'from csp.csp import *' and should not be imported directly. Copyright (C) Sarah Mount, 2008-10. This program is free software; you can redistribute it and/...
Python
#!/usr/bin/env python """ If you want to use the python-csp library then this is the file to import. It attempts to match the best possible implementation of CSP for your platform. If you wish to choose to use the multiprocess (multicore) or threaded version of the libraries explicitly then set an environment variabl...
Python
#!/usr/bin/env python """Builtin processes for python-csp. For guard types see csp.guards. Based on the JCSP PlugNPlay package. Copyright (C) Sarah Mount, 2009. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software...
Python
#!/usr/bin/env python """CSP Commstime benchmark. See F.R.M. Barnes (2006) Compiling CSP. In Proceedings of Communicating Process Architectures 2006. Code adapted from PyCSP by John Markus Bjorndalen, available: http://www.cs.uit.no/~johnm/code/PyCSP/ PyCSP - Communicating Sequential Processes for Python. John Mark...
Python
#!/usr/bin/env python """ Benchmark based on variable sized ring buffer. See also PyCSP papers in CPA2009 proceedings. Usage: tokenring-processes.py [options] Options: -h, --help show this help message and exit -t TOKENS, --tokens=TOKENS Number of tokens in token ring -n NODE...
Python
#!/usr/bin/env python """ Plotting results of variable ring buffer experiment. Copyright (C) Sarah Mount, 2009. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (...
Python
#!/usr/bin/python import os from urllib import urlopen from bs4 import BeautifulSoup output_dir = os.path.abspath('../assets/help') assert os.path.exists(output_dir) files_list_images = [] files_list_html = [ 'Manual', 'FAQ', 'StylusSupport', 'SupportedDevices', 'Permissions' ] def download_r...
Python
### ## * << Haru Free PDF Library 2.0.8 >> -- hpdf_consts.h ## * ## * URL http://libharu.org/ ## * ## * Copyright (c) 1999-2006 Takeshi Kanno ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that...
Python
### ## * << Haru Free PDF Library 2.0.3 >> -- hpdf_types.h ## * ## * URL http://libharu.org/ ## * ## * Copyright (c) 1999-2006 Takeshi Kanno ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that ...
Python
error_detail={ 0x1001: 'Internal error. The consistency of the data was lost.', 0x1002: 'Internal error. The consistency of the data was lost.', 0x1003: 'Internal error. The consistency of the data was lost.', 0x1004: 'The length of the data exceeds HPDF_LIMIT_MAX_STRING_LEN.', 0x1005: 'Cannot get a pallet dat...
Python
def printf(format, *optional): #print 'format="%s"' % format #print 'optional="%s"' % optional if len(optional)==1: optional=optional[0] if format.endswith('\n'): format=format[:-1] print format % optional
Python
## ## * << Haru Free PDF Library 2.0.8 >> -- hpdf.h ## * ## * URL http://libharu.org/ ## * ## * Copyright (c) 1999-2006 Takeshi Kanno ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the abo...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- png_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ab...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- permission.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- grid_sheet.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- ttfont_demo_jp.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that ...
Python
#coding=ISO8859-2 ### ## * << Haru Free PDF Library 2.0.0 >> -- outline_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- jpfont_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- encryption.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- ext_gstate_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- raw_image_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- jpeg_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the a...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- outline_demo_jp.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- text_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the a...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- font_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the a...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- encoding_list.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that t...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- ttfont_demo_jp.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that ...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- chfont_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- jpfont_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- image_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ...
Python
### ## * << Haru Free PDF Library 2.0.6 >> -- slideshow_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that ...
Python
#coding=utf-8 ### ## * << Haru Free PDF Library 2.0.0 >> -- text_annotation.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ##...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- character_map.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that t...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- line_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the a...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- ttfont_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- arc_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the ab...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- make_rawimage.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that t...
Python
### ## * << Alternative PDF Library 1.0.0 >> -- text_demo2.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that th...
Python
### ## * << Haru Free PDF Library 2.0.0 >> -- link_annotation.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that...
Python
#==================================================================== # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you ...
Python
from setuptools import setup, find_packages version = __import__('sqlserver_ado').get_version() setup( name='django-mssql', version=version.replace(' ', '-'), maintainer='Michael Manfre', maintainer_email='mmanfre@gmail.com', url='http://django-mssql.googlecode.com/', description="Dj...
Python
"""An example of using the internal DB-API module without any Django.""" # Adds the relative path for the MS SQL Server backend to Python's import path. # We do this so we can run this module from a checkout for demo purposes # without having to install it. def _hack_backend_path(): import os, sys backend_pat...
Python
# Common database settings for all test projects # plus a path hack to find the backend module. import os # use old style settings for non-django dbapi tests DATABASE_NAME = 'django_test_backend' DATABASE_HOST = os.environ['COMPUTERNAME'] + '\\' + os.environ.get('SQLINSTANCE', 'ss2008') DATABASE_USER = '' DA...
Python
# This dictionary maps Field objects to their associated Server Server column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict__. from django.conf import settings from django.db.backends.creation import BaseDatabaseCreation, TEST_DATAB...
Python
from django.db.models.sql import compiler import re # query_class returns the base class to use for Django queries. # The custom 'SqlServerQuery' class derives from django.db.models.sql.query.Query # which is passed in as "QueryClass" by Django itself. # # SqlServerQuery overrides: # ...insert queries to add "...
Python
"""A DB API 2.0 interface to SQL Server for Django Forked from: adodbapi v2.1 Copyright (C) 2002 Henrik Ekelund, version 2.1 by Vernon Cole * http://adodbapi.sourceforge.net/ * http://sourceforge.net/projects/pywin32/ This library is free software; you can redistribute it and/or modify it under the terms of t...
Python
from django.db.backends import BaseDatabaseOperations import datetime import time class DatabaseOperations(BaseDatabaseOperations): compiler_module = "sqlserver_ado.compiler" def date_extract_sql(self, lookup_type, field_name): return "DATEPART(%s, %s)" % (lookup_type, self.quote_name(fi...
Python
"""Microsoft SQL Server database backend for Django.""" from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures, BaseDatabaseValidation, BaseDatabaseClient from django.db.backends.signals import connection_created from django.core.exceptions import ImproperlyConfigured import dbapi as Database ...
Python
"""This module provides SQL Server specific fields for Django models.""" from django.db.models import AutoField, ForeignKey, BigIntegerField from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ __all__ = ( 'BigAutoField', 'BigForeignKey', 'BigIntegerField...
Python
# ADO enumerated constants documented on MSDN: # http://msdn.microsoft.com/en-us/library/ms678353(VS.85).aspx # IsolationLevelEnum adXactUnspecified = -1 adXactBrowse = 0x100 adXactChaos = 0x10 adXactCursorStability = 0x1000 adXactIsolated = 0x100000 adXactReadCommitted = 0x100...
Python
from django.db.backends import BaseDatabaseIntrospection import ado_consts class DatabaseIntrospection(BaseDatabaseIntrospection): def get_table_list(self, cursor): "Return a list of table and view names in the current database." cursor.execute("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLE...
Python
from django.db import connection from django.db.models.fields import * from south.db import generic class DatabaseOperations(generic.DatabaseOperations): """ django-mssql (sql_server.mssql) implementation of database operations. """ add_column_string = 'ALTER TABLE %s ADD %s;' alter_...
Python
import os.path VERSION = (1, 0, 0, 'dev') def get_version(): """ Return the version as a string. If this is flagged as a development release and mercurial can be loaded the specifics about the changeset will be appended to the version string. """ if 'dev' in VERSION: try:...
Python
from django.core.management.base import NoArgsCommand class Command(NoArgsCommand): help = "Launches SQL Server Management Studio (on Windows)." requires_model_validation = False def handle_noargs(self, **options): from django.conf import settings import os args = ['-n...
Python
import util import types from xml.sax.handler import * StartDocument = 0 EndDocument = 1 StartElement = 2 EndElement = 3 IgnorableWhitespace = 4 Characters = 5 def storeInDict(target, key, value): target[key] = value def storeInExistingAttribute(target, key, value, converter=None): if hasa...
Python
import util import types from xml.sax.handler import * StartDocument = 0 EndDocument = 1 StartElement = 2 EndElement = 3 IgnorableWhitespace = 4 Characters = 5 def storeInDict(target, key, value): target[key] = value def storeInExistingAttribute(target, key, value, converter=None): if hasa...
Python
#!/usr/bin/env python # # Copyright 2006, 2007 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for ...
Python
from distutils.dir_util import copy_tree copy_tree('.', 'snapshot', verbose=True)
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
#!/usr/bin/env python import glob import logging import os import sys import unittest from trace import fullmodname APP_ENGINE_PATH='../google_appengine' # Conditional import of cleanup function try: from tests.utils import cleanup except: def cleanup(): pass # Ensure current working directory is in path sys...
Python
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
Python
# Django settings for django_sample project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = 'database.sqlite3' DATABASE_USER = '' DATABASE_PASSWORD = '' DATABASE_HOST = '' DATABASE_PORT = '' # Lo...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the ...
Python
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the ...
Python
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
#!/usr/bin/python2.4 # # Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
Python
#!/usr/bin/python2.4 # -*- coding: utf-8 -*- # # Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
Python
import unittest import doctest class OptionalExtensionTestSuite(unittest.TestSuite): def run(self, result): import simplejson run = unittest.TestSuite.run run(self, result) simplejson._toggle_speedups(False) run(self, result) simplejson._toggle_speedups(True) ...
Python
"""Implementation of JSONEncoder """ import re from decimal import Decimal def _import_speedups(): try: from simplejson import _speedups return _speedups.encode_basestring_ascii, _speedups.make_encoder except ImportError: return None, None c_encode_basestring_ascii, c_make_encoder = _im...
Python
"""Implementation of JSONDecoder """ import re import sys import struct from simplejson.scanner import make_scanner def _import_c_scanstring(): try: from simplejson._speedups import scanstring return scanstring except ImportError: return None c_scanstring = _import_c_scanstring() __all...
Python
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained version of ...
Python
r"""Command-line tool to validate and pretty-print JSON Usage:: $ echo '{"json":"obj"}' | python -m simplejson.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m simplejson.tool Expecting property name: line 1 column 2 (char 2) """ import sys import simplejson as json def main(): ...
Python
"""JSON token scanner """ import re def _import_c_make_scanner(): try: from simplejson._speedups import make_scanner return make_scanner except ImportError: return None c_make_scanner = _import_c_make_scanner() __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))...
Python
"""Drop-in replacement for collections.OrderedDict by Raymond Hettinger http://code.activestate.com/recipes/576693/ """ from UserDict import DictMixin # Modified from original to support Python 2.4, see # http://code.google.com/p/simplejson/issues/detail?id=53 try: all except NameError: def all(seq): ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
#!/usr/bin/python2.4 # # Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
#!/usr/bin/python2.4 # # Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
Python
# Copyright (C) 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python