code
stringlengths
1
1.72M
language
stringclasses
1 value
# -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2011 Fredrik Strömberg <fredrik314@gmail.com> # # Distributed under the terms of the GNU General Public License (GPL) # # This code is distributed in the hope that it will be useful, # but WITH...
Python
# -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2010 Fredrik Strömberg <stroemberg@mathematik.tu-darmstadt.de>, # # Distributed under the terms of the GNU General Public License (GPL) # # This code is distributed in the hope that it will be use...
Python
# -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2010 Fredrik Strömberg <stroemberg@mathematik.tu-darmstadt.de>, # # Distributed under the terms of the GNU General Public License (GPL) # # This code is distributed in the hope that it will be use...
Python
#-*- coding: utf-8 -*- r""" Programs to compute holomorphic vector-valued Poincaré series. In particular to find a basis and compute aq gram matrix consisting of the Fouriercoefficients p_{D_i,r_i}(D_j,r_j) AUTHOR: - Fredrik Strömberg (May 2010) EXAMPLES:: sage: time A=make_gram_matrices(1,5,19.5,100,1E-20,f...
Python
r""" Algorithms for holomorphic and non-holomorphic Poincare series. """ from sage.all import ComplexField,inverse_mod from multiplier_systems import * from mysubgroup import * from poincare_series_alg import * class PoincareSeries(SageObject): def __init__(self,G,k=0,prec=53,multiplier=None,verbose=0,holomorph...
Python
################################################################################# # # (c) Copyright 2010 Fredrik Stroemberg # # This file is part of PSAGE # # PSAGE 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 Foun...
Python
""" Excerpt from my MySubgroup class. Contains routines to draw fundamental domains. r""" import matplotlib.patches as patches import matplotlib.path as path from sage.all import I,Gamma0,Gamma1,Gamma,SL2Z,ZZ,RR,ceil,sqrt,CC,line,text,latex,exp,pi,infinity def draw_fundamental_domain(N,group='Gamma0',model="H",axes=...
Python
# -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2010 Fredrik Strömberg <fredrik314@gmail.com> # # Distributed under the terms of the GNU General Public License (GPL) # # This code is distributed in the hope that it will be useful, # but WITH...
Python
# -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2010 Fredrik Strömberg <stroemberg@mathematik.tu-darmstadt.de>, # # Distributed under the terms of the GNU General Public License (GPL) # # This code is distributed in the hope that it will be use...
Python
from inc_gamma import incgamma_int,incgamma_hint,pochammer from mysubgroups_alg import SL2Z_elt,factor_matrix_in_sl2z,ncf_to_SL2Z_element from permutation_alg import MyPermutation,MyPermutationIterator from mysubgroup import MySubgroup,HeckeTriangleGroup,nearest_integer_continued_fraction from maass_forms import Maass...
Python
from prime import primes_of_bounded_norm from misc import F, a
Python
from sage.rings.all import NumberField, QQ R = QQ['x'] x = R.gen() F = NumberField(x*x - x- 1, 'a') a = F.gen()
Python
import sqrt5
Python
from modform import * from matrix import * from modules import * from rings import * from function_fields import FunctionField from ellff import ellff_EllipticCurve import number_fields from zfunctions import *
Python
################################################################################# # # (c) Copyright 2010 Fredrik Stroemberg # # This file is part of PSAGE # # PSAGE 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 Foun...
Python
# from matrix_complex_dense import Matrix_complex_dense
Python
# -*- coding: utf-8 -*- r""" Selberg Zeta function and transfer operator for Hecke triangle groups. This file contains the classes SelbergZeta and TransferOperator and methods to compute the values of the Selberg Z-function on Hecke triangle groups using the transfer operator method. For an explanation of the algorith...
Python
from selberg_z import SelbergZeta,TransferOperator
Python
def userpass(): import getpass username = raw_input('Mongodb username: ') password = getpass.getpass() return username, password
Python
################################################################################# # # (c) Copyright 2010 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2010 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
""" Queries This file contains code that carries out interesting queries regarding the database of elliptic curves. """ def counts_collection(address='localhost:29000'): from psage.lmfdb.auth import userpass user, password = userpass() from pymongo import Connection from pymongo.connection import Dupl...
Python
################################################################################# # # (c) Copyright 2011 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2011 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2011 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2011 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2011 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2011 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
# Elliptic curves over Q(sqrt(5))
Python
# elliptic curves
Python
################################################################################# # # (c) Copyright 2011 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2010 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2010 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2010 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2010 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2010 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
################################################################################# # # (c) Copyright 2010 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
""" (c) Copyright 2009-2010 Salman Baig and Chris Hall This file is part of ELLFF ELLFF is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later versi...
Python
from ellff import ellff_EllipticCurve
Python
################################################################################# # # (c) Copyright 2010 William Stein # # This file is part of PSAGE # # PSAGE 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 Foundatio...
Python
#!/usr/bin/env python import time t = time.time() u = time.gmtime(t) s = time.strftime('%a, %e %b %Y %T GMT', u) print 'Content-Type: text/javascript' print 'Cache-Control: no-cache' print 'Date: ' + s print 'Expires: ' + s print '' print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
Python
''' Module which prompts the user for translations and saves them. TODO: implement @author: Rodrigo Damazio ''' class Translator(object): ''' classdocs ''' def __init__(self, language): ''' Constructor ''' self._language = language def Translate(self, string_names): print string_names
Python
''' Module which brings history information about files from Mercurial. @author: Rodrigo Damazio ''' import re import subprocess REVISION_REGEX = re.compile(r'(?P<hash>[0-9a-f]{12}):.*') def _GetOutputLines(args): ''' Runs an external process and returns its output as a list of lines. @param args: the argume...
Python
''' Module which parses a string XML file. @author: Rodrigo Damazio ''' from xml.parsers.expat import ParserCreate import re #import xml.etree.ElementTree as ET class StringsParser(object): ''' Parser for string XML files. This object is not thread-safe and should be used for parsing a single file at a time...
Python
#!/usr/bin/python ''' Entry point for My Tracks i18n tool. @author: Rodrigo Damazio ''' import mytracks.files import mytracks.translate import mytracks.validate import sys def Usage(): print 'Usage: %s <command> [<language> ...]\n' % sys.argv[0] print 'Commands are:' print ' cleanup' print ' translate' p...
Python
''' Module which compares languague files to the master file and detects issues. @author: Rodrigo Damazio ''' import os from mytracks.parser import StringsParser import mytracks.history class Validator(object): def __init__(self, languages): ''' Builds a strings file validator. Params: @para...
Python
''' Module for dealing with resource files (but not their contents). @author: Rodrigo Damazio ''' import os.path from glob import glob import re MYTRACKS_RES_DIR = 'MyTracks/res' ANDROID_MASTER_VALUES = 'values' ANDROID_VALUES_MASK = 'values-*' def GetMyTracksDir(): ''' Returns the directory in which the MyTrac...
Python
from twisted.application import internet, service from franticfallacy import communications, engine, data, config world = data.loadWorld(config.worldpath) chatFac = communications.ChatFactory() chatFac.motd = config.motd chatFac.world = world chatService = service.MultiService() internet.TCPServer(config.port, chat...
Python
#ANSI colors BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(30, 38) BOLD, NORMAL = 1, 22 def ansi(code): return '\x1B[%sm' % code def colstr(code, str, finish = 0): return '%s%s%s' % (ansi(code), str, ansi(finish)) #message types MSG_SYSTEM, MSG_SYS_INFO, MSG_SYS_EVENT, MSG_SYS_ERR, MSG_CHAT, MSG_EMO...
Python
import os import pprint from franticfallacy import engine from franticfallacy.datafile import grammar class Loader(object): target = None rules = None def __init__(self, object, ruleset): self.target = object self.rules = ruleset def takeResults(self, results): for entity in results: print '%s loadin...
Python
from twisted.internet import defer, reactor import random, copy, time import operator rng = random.SystemRandom() from formatting import * class EngineError(Exception): pass class AbilityError(EngineError): pass class NotReadyError(AbilityError): pass class DisallowedPlaceError(AbilityError): pass class NoMpError...
Python
from twisted.internet import protocol, defer, reactor from twisted.internet.task import LoopingCall from twisted.protocols import basic import re import time from franticfallacy.formatting import * try: set except NameError: from sets import Set as set CONSTATE_NAME, CONSTATE_PWD, CONSTATE_ROLE, CONSTATE_MAIN = r...
Python
import pyparsing as p single_quoted_string = p.QuotedString("'", '\\') double_quoted_string = p.QuotedString('"', '\\') numeral = p.Word(p.nums) number = p.Combine(p.Optional(p.Literal('-')) + numeral + p.Optional(p.Literal('.') + p.Optional(numeral))) dee = p.Literal('d').suppress() dice_roll = numeral + dee + n...
Python
port = 4002 motd = 'Frantic Fallacy 2a1' worldpath = 'data/world' playerpath = 'data/player'
Python
from twisted.application import internet, service from franticfallacy import communications, engine, data, config world = data.loadWorld(config.worldpath) chatFac = communications.ChatFactory() chatFac.motd = config.motd chatFac.world = world chatService = service.MultiService() internet.TCPServer(config.port, chat...
Python
#ANSI colors BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(30, 38) BOLD, NORMAL = 1, 22 def ansi(code): return '\x1B[%sm' % code def colstr(code, str, finish = 0): return '%s%s%s' % (ansi(code), str, ansi(finish)) #message types MSG_SYSTEM, MSG_SYS_INFO, MSG_SYS_EVENT, MSG_SYS_ERR, MSG_CHAT, MSG_EMO...
Python
import copy import engine import os def loadWorld(dir): world = engine.World() files = os.listdir(dir) #print files for fn in files: try: f = open( os.path.join(dir, fn) ) name = os.path.splitext(fn)[0] worldFile = engine.WorldFile(name) world.worldFiles[name] = worldFile loadWorldFile(worldFile...
Python
from twisted.internet import defer, reactor import random, copy, time import operator rng = random.SystemRandom() from formatting import * class EngineError(Exception): pass class AbilityError(EngineError): pass class NotReadyError(AbilityError): pass class DisallowedPlaceError(AbilityError): pass class NoMpError...
Python
from twisted.internet import protocol, defer, reactor from twisted.internet.task import LoopingCall from twisted.protocols import basic import re import time from formatting import * try: set except NameError: from sets import Set as set CONSTATE_NAME, CONSTATE_PWD, CONSTATE_ROLE, CONSTATE_MAIN = range(0,4) TIME...
Python
port = 4002 motd = 'Frantic Fallacy 2a1' worldpath = 'data/world' playerpath = 'data/player'
Python
#!/usr/bin/env python # Copyright (c) 2007, 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
#!/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
#!/usr/bin/python2.5 # # Copyright 2011 Google Inc. All Rights Reserved. # # 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 require...
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
# 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
# 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
#!/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.5 # # Copyright 2011 Google Inc. All Rights Reserved. # # 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 require...
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
"""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
#!/usr/bin/python2.5 # # Copyright 2011 Google Inc. All Rights Reserved. # # 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 require...
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/python2.5 # # Copyright 2011 Google Inc. All Rights Reserved. # # 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 require...
Python
#!/usr/bin/python2.5 # # Copyright 2011 Google Inc. All Rights Reserved. # # 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 require...
Python
#!/usr/bin/python2.5 # # Copyright 2011 Google Inc. All Rights Reserved. # # 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 require...
Python
""" Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import datetime import struct import time import sys import os relativedelta = None pa...
Python
""" Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import itertools import datetime import calendar import thread import sys __all__ = ["...
Python
""" Copyright (c) 2003-2005 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ from dateutil.tz import tzfile from tarfile import TarFile import os __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" __all__ = ["setca...
Python
""" Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import datetime import calendar __all__ = ["relativedelta", "MO", "TU", "WE", "TH", "F...
Python
# This code was originally contributed by Jeffrey Harris. import datetime import struct import _winreg __author__ = "Jeffrey Harris & Gustavo Niemeyer <gustavo@niemeyer.net>" __all__ = ["tzwin", "tzwinlocal"] ONEWEEK = datetime.timedelta(7) TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones" TZ...
Python
""" Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" __version__ = "1.5"
Python
""" Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import datetime __all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTE...
Python
import _winreg import struct import datetime handle=_winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE) tzparent=_winreg.OpenKey(handle, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones") parentsize=_winreg.QueryInfoKey(tzparent)[0] localkey=_winreg.OpenKey(handle, "SYSTEM\\C...
Python
"""Compare VTODOs and VEVENTs in two iCalendar sources.""" from base import Component, getBehavior, newFromBehavior def getSortKey(component): def getUID(component): return component.getChildValue('uid', '') # it's not quite as simple as getUID, need to account for recurrenceID and # sequence...
Python
"""Behavior (validation, encoding, and transformations) for vobjects.""" import base #------------------------ Abstract class for behavior -------------------------- class Behavior(object): """Abstract class to describe vobject options, requirements and encodings. Behaviors are used for root components l...
Python
"""vobject module for reading vCard and vCalendar files.""" import copy import re import sys import logging import StringIO, cStringIO import string import exceptions import codecs #------------------------------------ Logging ---------------------------------- logger = logging.getLogger(__name__) if not logging.getL...
Python
"""Definitions and behavior for vCard 3.0""" import behavior import itertools from base import VObjectError, NativeError, ValidateError, ParseError, \ VBase, Component, ContentLine, logger, defaultSerialize, \ registerBehavior, backslashEscape, ascii from icalendar import strin...
Python
"""Translate an ics file's events to a different timezone.""" from optparse import OptionParser from vobject import icalendar, base import sys try: import PyICU except: PyICU = None from datetime import datetime def change_tz(cal, new_timezone, default, utc_only=False, utc_tz=icalendar.utc): for vevent i...
Python