code
stringlengths
1
1.72M
language
stringclasses
1 value
""" This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ ...
Python
from django import template from django import forms from django.http import HttpResponseRedirect from pirate_forum.templatetags.blobtags import get_form from pirate_forum.models import ForumDimension from pirate_consensus.models import Consensus from pirate_topics.models import Topic from pirate_core.views import Htt...
Python
# Create your views here.
Python
from django.contrib import admin from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.comments.signals import comment_was_posted from pirate_issues.callbacks import update_issue_comment_count #from ModuleDeliberation.models import Comment from django.utils.translat...
Python
from django import forms from django.forms.extras import SelectDateWidget from pirate_issues.models import Problem, Solution, Policy from pirate_topics.models import Topic from pirate_forum.forms import BlobForm from pirate_core.forms import FormMixin from pirate_core.widgets import HorizRadioRenderer from django.contr...
Python
import testlib, pirate_issues __test__ = testlib.get_test_dict(pirate_issues, locals())
Python
from pirate_signals.models import aso_rep_event from pirate_reputation.models import ReputationDimension #Updates the issue.comments for each comment being posted def update_issue_comment_count(sender, comment, request, **kwargs): aso_rep_event.send(sender = sender,event_score=1, user=comment.user, dimension=Reput...
Python
from django.conf.urls.defaults import * from pirate_issues import views urlpatterns = patterns('', url(r'topics/', views.get_all_topics, name="topic_list"), url(r'topic/(?P<topic>\d+)/$', views.get_topic, name="get_topic"), # url(r'upvote/(?P<topic>\d+)/(?P<issue_id>\d+)/$', views.upvote, name="upvote"), ...
Python
from django import template from django import forms from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 import datetime from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from pirate_core import HttpRedirectException, namespace...
Python
from django import template from django import forms from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 import datetime from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from pirate_core import HttpRedirectException, namespace...
Python
from django import template from django import forms from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 import datetime from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from pirate_core import HttpRedirectException, namespace...
Python
from django.template import Context, loader from pirate_issues.models import Issue, Topic#, Argument from django.http import HttpResponse from django.views.generic.list_detail import object_list from annoying.decorators import render_to, ajax_request from annoying.helpers import get_object_or_404_ajax from django.short...
Python
import search from search.core import startswith, porter_stemmer from models import Problem, Solution, Policy search.register(Problem, ('summary','description'), search_index='autocomplete_index',indexer=startswith) search.register(Problem, ('summary','description'), search_index='search_index',indexer=porter_stemmer)...
Python
from django.db import models from django import template from django.contrib import admin from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic #from ModuleDeliberation.models import Comment from django.utils.translation im...
Python
from django import forms from pirate_actions.models import Action from pirate_topics.models import Topic from pirate_core.forms import FormMixin from markitup.widgets import MarkItUpWidget from pirate_core.widgets import SelectTimeWidget, HorizRadioRenderer from django.forms.extras import SelectDateWidget import dateti...
Python
""" This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ ...
Python
# Create your views here.
Python
"""Integrates django-notification into the OpenAssembly system. pirate_messages.models.create_notification users signals to create flexible notifications from django-notifications """ from django.contrib.sites.models import Site from django.conf import settings from django.db.models import signals current_si...
Python
from django.db import models class RankingDimension(models.Model): #Dimensions store name = models.CharField(max_length=70) created_dt = models.DateTimeField(auto_now_add=True) modified_dt = models.DateTimeField(auto_now=True) class BaseRankingAbstractModel(models.Model): # Generic ranking objec...
Python
from BeautifulSoup import BeautifulSoup acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area', 'b', 'big', 'blockquote', 'br', 'button', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'font', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', '...
Python
import hashlib from django.utils.translation import ugettext_lazy as _ from google.appengine.api import images from exceptions import ValueError, TypeError from django import forms from django.utils.datastructures import SortedDict from pirate_core import HttpRedirectException class FormMixin(object): @classme...
Python
import testlib, pirate_core __test__ = testlib.get_test_dict(pirate_core, locals())
Python
from django.http import HttpResponseRedirect from django.contrib.contenttypes.models import ContentType from customtags.decorators import block from pirate_core import FormMixin, ComboFormFactory, namespace_get from django import template from customtags.decorators import block_decorator register = template.Library(...
Python
import math, re from django.template import Library, Node, TemplateSyntaxError, VariableDoesNotExist, resolve_variable from django.conf import settings register = Library() DIV_TEMPLATE = "<div id=\"star_strip_%s\">" END_DIV_TEMPLATE= "</div>" IMG_TEMPLATE = "<img border=\"0\" src=\"%s\" alt=\"%s\"/>" EX_IMG_TEMPLAT...
Python
from django import template from django import forms from django.http import HttpResponseRedirect import datetime from django.contrib.contenttypes.models import ContentType from tagging.models import Tag, TaggedItem from django.db.models import get_model from pirate_consensus.models import Consensus from settings impor...
Python
from exceptions import ValueError from django import template from django.db import models from django.core.urlresolvers import reverse from django.contrib.contenttypes.models import ContentType import string from customtags.decorators import function_decorator register = template.Library() function = function_decora...
Python
import re from django.forms.extras.widgets import SelectDateWidget from django.forms.widgets import Widget, Select, MultiWidget from django.utils.safestring import mark_safe from django import forms __all__ = ('SelectTimeWidget', 'SplitSelectDateTimeWidget') # Attempt to match many time formats: # Example: "12:34:56 ...
Python
from pirate_core.views import * from pirate_core.models import * from pirate_core.forms import *
Python
from exceptions import ValueError from django.template import RequestContext, loader, add_to_builtins from django.template import TemplateSyntaxError, TemplateDoesNotExist from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound from django.contrib.contenttypes.models import ContentType from dja...
Python
from django.contrib.contenttypes.models import ContentType from django.template import add_to_builtins import datetime from pirate_forum.models import View, create_view from google.appengine.ext import deferred TYPE_KEY = "_t" OBJ_KEY = "_o" START_KEY = "_s" END_KEY = "_e" DIM_KEY = "_d" SCROLL_KEY = "_c" RETURN_KEY =...
Python
#!/usr/bin/env python # Add "common-apps" folder to sys.path if it exists import os, sys common_dir = os.path.join(os.path.dirname(__file__), 'common-apps') if os.path.exists(common_dir): sys.path.append(common_dir) # Initialize App Engine SDK if djangoappengine backend is installed try: from djangoappengine....
Python
#!/usr/local/bin/python2.6 # Created on October 31, 2011 # by Keith Cherkauer # # This program computes annual metrics from the daily streamflow flies # for the Tippecanoe River and Wildcat Creek. # import sys, os from stats import * from datetime import datetime, timedelta NoDataVal = -999.99 # check...
Python
#!/opt/local/bin/python import sys, os from stats import * from datetime import datetime, timedelta NoDataVal = -999.99 # check for proper number of command line arguments if ( len( sys.argv ) != 3 ): sys.stderr.write( "\nUsage: %s <daily flow file> <output stat file>\n\n" % sys.argv[0] ) sys.exit() # handle ...
Python
#!/usr/local/bin/python # # Created on July 10, 2000 # by Keith Cherkauer # # This python script computes several standard statistics on arrays # of values # # Functions include: # get_mean # get_median # get_var # get_stdev # get_skew # get_sum # get_min # get_max # get_count_over_threshold ...
Python
#!/usr/local/bin/python # # Created on July 10, 2000 # by Keith Cherkauer # # This python script computes several standard statistics on arrays # of values # # Functions include: # get_mean # get_median # get_var # get_stdev # get_skew # get_sum # get_min # get_max # get_count_over_threshold ...
Python
#!/usr/local/bin/python2.6 # Created on October 31, 2011 # by Keith Cherkauer # # This program computes annual metrics from the daily streamflow flies # for the Tippecanoe River and Wildcat Creek. # import sys, os from stats import * from datetime import datetime, timedelta NoDataVal = -999.99 # check...
Python
#This program processes soil temperature date given on http://www.ncdc.noaa.gov/oa/soil/data/ in order #to obtain the following: average annual soil temperature at depth 50 cm from the soil surface. #To obtain this average, daily values are summed to give a monthly average. Then monthly averages #are summed to give ...
Python
#!/opt/local/bin/python import sys, os from stats import * from datetime import datetime, timedelta NoDataVal = -999.99 # check for proper number of command line arguments if ( len( sys.argv ) != 3 ): sys.stderr.write( "\nUsage: %s <daily flow file> <output stat file>\n\n" % sys.argv[0] ) sys.exit() # handle ...
Python
#!/usr/bin/python # # Copyright (C) 2012 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 ...
Python
#!/usr/bin/python # # Copyright (C) 2012 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 ...
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
# This is the version of this source code. manual_verstr = "1.5" auto_build_num = "211" verstr = manual_verstr + "." + auto_build_num try: from pyutil.version_class import Version as pyutil_Version __version__ = pyutil_Version(verstr) except (ImportError, ValueError): # Maybe there is no pyutil insta...
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 2011 Google Inc. All Rights Reserved. """Multi-credential file store with lock support. This module implements a JSON credential store where multiple credentials can be stored in one file. That file supports locking both in a single process and across processes. The credential themselves are keyed off 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
# 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 # -*- coding: utf-8 -*- # # Copyright (C) 2011 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
# Copyright (C) 2011 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 2011 Google Inc. All Rights Reserved. """Locked file interface that should work on Unix and Windows pythons. This module first tries to use fcntl locking to ensure serialized access to a file, then falls back on a lock file if that is unavialable. Usage: f = LockedFile('filename', 'r+b', 'rb') f....
Python
__version__ = "1.0c2"
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
import Cookie import datetime import time import email.utils import calendar import base64 import hashlib import hmac import re import logging # Ripped from the Tornado Framework's web.py # http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09 # # Tornado is licensed under the Apache Licen...
Python
# Copyright (C) 2007 Joe Gregorio # # Licensed under the MIT License """MIME-Type Parser This module provides basic functions for handling mime-types. It can handle matching mime-types against a list of media-ranges. See section 14.1 of the HTTP specification [RFC 2616] for a complete explanation. http://www.w3.o...
Python
# Copyright (C) 2012 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
__version__ = "1.0c2"
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
# Early, and incomplete implementation of -04. # import re import urllib RESERVED = ":/?#[]@!$&'()*+,;=" OPERATOR = "+./;?|!@" EXPLODE = "*+" MODIFIER = ":^" TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE) VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part...
Python
#!/usr/bin/env python # Copyright (c) 2010, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this l...
Python
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this ...
Python
""" iri2uri Converts an IRI to a URI. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright 2006, Joe Gregorio" __contributors__ = [] __version__ = "1.0.0" __license__ = "MIT" __history__ = """ """ import urlparse # Convert an IRI to a URI following the rules in RFC 3987 # # The characte...
Python
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright...
Python
#!/usr/bin/env python # # Copyright (c) 2002, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this ...
Python
refjast="reference.jast" ################################################## ##GAMESS INPUT ################################################# gamess_header="""\ $CONTRL SCFTYP=UHF MULT=1 ICHARG=0 RUNTYP=GRADIENT MAXIT=70 ECP=READ $END $CONTRL UNITS=BOHR $END $SYSTEM KDIAG=3 $END $SCF DIRSCF=.T. RSTRCT=.T. SOSCF=.F...
Python
import os import string gamess2qmc="gamess2qmc" gamess="nohup nice /home/apps/gamess/rungms" gos="/home/lkwagner/qmcsources/qmc_inherit/gos-Linux-3.2" #We want to read the sysdef module from the current #directory, so add this to Python's search path import sys sys.path.insert(0,".") from sysdef import * def print...
Python
#!/usr/bin/env python import sys f=open(sys.argv[1],'r') tokens=f.readlines() in_jastrow=False nopen=0 nclose=0 for line in tokens: if line.find("JASTROW2") != -1: in_jastrow=True if in_jastrow: nopen+=line.count("{") nclose+=line.count("}") if in_jastrow and nopen >= nclose: print line,
Python
#!/usr/bin/python #Insert BSD License (http://opensource.org/licenses/BSD-2-Clause) ############################################################################## # Copyright (c) 2012, Christopher P. Barnes ( senrabc at gmail.com ) # All rights reserved. # # Redistribution and use in source and binary forms, with or ...
Python
#!/usr/bin/python #Insert BSD License (http://opensource.org/licenses/BSD-2-Clause) ############################################################################## # Copyright (c) 2012\ # Carlo Torniai (carlotorniai at gmail.com) # All rights reserved. # # Redistribution and use in source and binary forms, with or wit...
Python
host='your_host' port=3306 user = 'your_user' password = 'your_password#71' database= 'your_db'
Python
#!/usr/bin/python #Insert BSD License (http://opensource.org/licenses/BSD-2-Clause) ############################################################################## # Copyright (c) 2012, Carlo Torniai ( carlotonriai at gmail.com ) # All rights reserved. # # Redistribution and use in source and binary forms, with or wit...
Python
#!/usr/bin/python #Insert BSD License (http://opensource.org/licenses/BSD-2-Clause) ############################################################################## # Copyright (c) 2012, Christopher P. Barnes ( senrabc at gmail.com ) # Carlo Torniai # All rights reserved. # # Redistribution and use in source and binary...
Python
from tagCloud import * import MySQLdb import Connection import csv # Creates aTagcloud for a user a user verbose = True def getProvidersfromCSV(filename): providers=[] f = open(filename, 'rU') dialect = csv.Sniffer().sniff(f.readline()) f.seek(0) reader = csv.DictReader(f, dialect=dialect) for...
Python
#!/usr/bin/python #Insert BSD License (http://opensource.org/licenses/BSD-2-Clause) ############################################################################## # Copyright (c) 2012\ # Carlo Torniai (carlotorniai at gmail.com) # All rights reserved. # # Redistribution and use in source and binary forms, with or wit...
Python
#!/usr/bin/python #Insert BSD License (http://opensource.org/licenses/BSD-2-Clause) ############################################################################## # Copyright (c) 2012\ # Carlo Torniai (carlotorniai at gmail.com) # All rights reserved. # # Redistribution and use in source and binary forms, with or wit...
Python
import csv import matplotlib.pyplot as plt from numpy import * # For installing numpy sudo easy_install -U numpy filename = './results/1679581102.xls' lines = open(filename).readlines() x=[] y_temp=[] y=[] label=[] for line in lines: value = line.split('\t') y_temp.append(int(value[2])) label.append(str...
Python
#!/usr/bin/python #Insert BSD License (http://opensource.org/licenses/BSD-2-Clause) ############################################################################## # Copyright (c) 2012\ # Carlo Torniai (carlotorniai at gmail.com) # All rights reserved. # # Redistribution and use in source and binary forms, with or wit...
Python
# Defines the clouds for Mesh terms and Scival concepts and related methods class tag_occurrences: def __init__(self, tagname, occurrences, weight): self.name = tagname self.occurrences = occurrences self.weight = weight class tag: def __init__(self, tagname, weight): self.nam...
Python
#!/usr/bin/python # Copyright 2011 Google, Inc. All Rights Reserved. # simple script to walk source tree looking for third-party licenses # dumps resulting html page to stdout import os, re, mimetypes, sys # read source directories to scan from command line SOURCE = sys.argv[1:] # regex to find /* */ style commen...
Python
#!/usr/bin/python # # Copyright (C) 2012 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 ...
Python
#!/usr/bin/python # # Copyright (C) 2012 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 ...
Python
#!/usr/bin/env python # # Copyright (c) 2002, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this ...
Python
#!/usr/bin/env python # Copyright (c) 2010, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this 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
#!/usr/bin/python2.4 # -*- coding: utf-8 -*- # # Copyright (C) 2011 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
# Copyright 2011 Google Inc. All Rights Reserved. """Locked file interface that should work on Unix and Windows pythons. This module first tries to use fcntl locking to ensure serialized access to a file, then falls back on a lock file if that is unavialable. Usage: f = LockedFile('filename', 'r+b', 'rb') f....
Python
# Copyright 2011 Google Inc. All Rights Reserved. """Multi-credential file store with lock support. This module implements a JSON credential store where multiple credentials can be stored in one file. That file supports locking both in a single process and across processes. The credential themselves are keyed off 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