code
stringlengths
1
1.72M
language
stringclasses
1 value
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'HelpEntry' db.create_table('help_helpentry', ( ('id', self.gf('django.db.model...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'HelpEntry.db_lock_storage' db.alter_column('help_helpentry', 'db_lock_storage', self.gf(...
Python
""" Custom manager for HelpEntry objects. """ from django.db import models from src.utils import logger, utils class HelpEntryManager(models.Manager): """ This implements different ways to search for help entries. """ def find_topicmatch(self, topicstr, exact=False): """ Searches for ma...
Python
# # This sets up how models are displayed # in the web admin interface. # from django import forms from django.conf import settings from django.contrib import admin from src.objects.models import ObjAttribute, ObjectDB, ObjectNick, Alias from src.utils.utils import mod_import class ObjAttributeInline(a...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ObjAttribute' db.create_table('objects_objattribute', ( ('id', self.gf('django.db.mode...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models, utils class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # we need to add a default lock string to all objects, then a separate set ...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding index on 'ObjectDB', fields ['db_key'] db.create_index('objects_objectdb', ['db_key']) #...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from src.objects.models import ObjectDB class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ObjectDB.db_destination' db.add_column('objects_ob...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'ObjAttribute.db_mode' from src.objects.models import ObjAttribute from ...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models, utils class Migration(SchemaMigration): def forwards(self, orm): try: # if we migrate, we just rename the table. This will move over all values too. db.rena...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'ObjectDB.db_cmdset_storage' db.alter_column('objects_objectdb', 'db_cmdset_storage', sel...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models, utils class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." lockstring1 = 'control:id(1);get:all();edit:perm(Wizards);view:all();examin...
Python
""" Custom manager for Objects. """ from django.conf import settings from django.contrib.auth.models import User from django.db.models.fields import exceptions from src.typeclasses.managers import TypedObjectManager from src.typeclasses.managers import returns_typeclass, returns_typeclass_list from src.utils import ut...
Python
""" This module defines the database models for all in-game objects, that is, all objects that has an actual existence in-game. Each database object is 'decorated' with a 'typeclass', a normal python class that implements all the various logics needed by the game in question. Objects created of this class transparent...
Python
""" This is the basis of the typeclass system. The idea is have the object as a normal class with the database-connection tied to itself through a property. The instances of all the different object types are all tied to their own database object stored in the 'dbobj' property. All attribute get/set operations are ...
Python
# -*- coding: utf-8 -*- """ Unit testing of the 'objects' Evennia component. Runs as part of the Evennia's test suite with 'manage.py test" Please add new tests to this module as needed. Guidelines: A 'test case' is testing a specific component and is defined as a class inheriting from unittest.TestCase. The test...
Python
""" MSDP (Mud Server Data Protocol) This implements the MSDP protocol as per http://tintin.sourceforge.net/msdp/. MSDP manages out-of-band communication between the client and server, for updating health bars etc. !TODO - this is just a partial implementation and not used by telnet yet. """ import re # variables ...
Python
# # This sets up how models are displayed # in the web admin interface. # from django.contrib import admin from src.server.models import ServerConfig class ServerConfigAdmin(admin.ModelAdmin): "Custom admin for server configs" list_display = ('db_key', 'db_value') list_display_links = ('db_ke...
Python
""" This module implements the main Evennia server process, the core of the game engine. This module should be started with the 'twistd' executable since it sets up all the networking features. (this is done automatically by game/evennia.py). """ import time import sys import os if os.name == 'nt': # For Window...
Python
""" This module implements the telnet protocol. This depends on a generic session module that implements the actual login procedure of the game, tracks sessions etc. """ from twisted.conch.telnet import Telnet, StatefulTelnetProtocol, IAC, LINEMODE, DO, DONT from src.server.session import Session from src.server i...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models, utils import pickle class Migration(SchemaMigration): no_dry_run = True def forwards(self, orm): try: db.rename_table("config_configvalue", "server_serverconfig...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models, utils import pickle class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # we are fixing a situation were the serverconfig v...
Python
""" This implements resources for twisted webservers using the wsgi interface of django. This alleviates the need of running e.g. an apache server to serve Evennia's web presence (although you could do that too if desired). The actual servers are started inside server.py as part of the Evennia application. (Lots of t...
Python
""" Web client server resource. The Evennia web client consists of two components running on twisted and django. They are both a part of the Evennia website url tree (so the testing website might be located on http://localhost:8000/, whereas the webclient can be found on http://localhost:8000/webclient.) /webclient...
Python
""" Custom manager for ServerConfig objects. """ from django.db import models class ServerConfigManager(models.Manager): """ This gives some access methods to search and edit the configvalue database. If no match is found, return default. """ def conf(self, key=None, value=None, delete=False...
Python
""" MCCP - Mud Client Compression Protocol The implements the MCCP v2 telnet protocol as per http://tintin.sourceforge.net/mccp/. MCCP allows for the server to compress data when sending to supporting clients, reducing bandwidth by 70-90%.. The compression is done using Python's builtin zlib library. If the client do...
Python
""" Server Configuration flags This holds persistent server configuration flags. Config values should usually be set through the manager's conf() method. """ try: import cPickle as pickle except ImportError: import pickle from django.db import models from src.utils.idmapper.models import SharedMemoryMode...
Python
""" MSSP - Mud Server Status Protocol This implements the MSSP telnet protocol as per http://tintin.sourceforge.net/mssp/. MSSP allows web portals and listings to have their crawlers find the mud and automatically extract relevant information about it, such as genre, how many active players and so on. Most of th...
Python
""" This is a simple context factory for auto-creating SSL keys and certificates. """ import os, sys from twisted.internet import ssl as twisted_ssl try: import OpenSSL except ImportError: print _(" SSL_ENABLED requires PyOpenSSL.") sys.exit(5) from src.server.telnet import TelnetProtocol class SSLPro...
Python
""" This module defines handlers for storing sessions when handles sessions of users connecting to the server. There are two similar but separate stores of sessions: ServerSessionHandler - this stores generic game sessions for the game. These sessions has no knowledge about how they are connecte...
Python
""" This defines a the Server's generic session object. This object represents a connection to the outside world but don't know any details about how the connection actually happens (so it's the same for telnet, web, ssh etc). It is stored on the Server side (as opposed to protocol-specific sessions which are stored...
Python
""" This defines a generic session class. All connection instances (both on Portal and Server side) should inherit from this class. """ import time #------------------------------------------------------------ # Server Session #------------------------------------------------------------ class Session(object): ...
Python
""" TTYPE (MTTS) - Mud Terminal Type Standard This module implements the TTYPE telnet protocol as per http://tintin.sourceforge.net/mtts/. It allows the server to ask the client about its capabilities. If the client also supports TTYPE, it will return with information such as its name, if it supports colour etc. If th...
Python
""" This module implements the ssh (Secure SHell) protocol for encrypted connections. This depends on a generic session module that implements the actual login procedure of the game, tracks sessions etc. Using standard ssh client, """ import os from twisted.cred.checkers import credentials from twisted.cred.portal...
Python
""" Contains the protocols, commands, and client factory needed for the server to service the MUD portal proxy. The separation works like this: Portal - (AMP client) handles protocols. It contains a list of connected sessions in a dictionary for identifying the respective player connected. If it looses the ...
Python
""" This module handles initial database propagation, which is only run the first time the game starts. It will create some default channels, objects, and other things. Everything starts at handle_setup() """ from django.contrib.auth.models import User from django.core import management from django.conf import settin...
Python
""" This module implements the main Evennia server process, the core of the game engine. This module should be started with the 'twistd' executable since it sets up all the networking features. (this is done automatically by game/evennia.py). """ import time import sys import os import signal if os.name == 'nt': ...
Python
# # This sets up how models are displayed # in the web admin interface. # from django import forms from django.db import models from django.conf import settings from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.admin import widgets from django.cont...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ("objects", "0001_initial"), ) def forwards(self, orm): # Adding model 'PlayerAttribute' db.create_table('p...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding index on 'PlayerDB', fields ['db_key'] db.create_index('players_playerdb', ['db_key']) #...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models, utils from django.conf import settings class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." try: for player in orm.PlayerD...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PlayerNick' db.create_table('players_playernick', ( ('id', self.gf('django.db....
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'PlayerDB.db_cmdset_storage' db.alter_column('players_playerdb', 'db_cmdset_storage', sel...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'PlayerAttribute.db_mode' from src.players.models import PlayerAttribute from sr...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'PlayerDB.db_cmdset_storage' db.add_column('players_playerdb', 'db_cmdset_storage', self.gf...
Python
""" The managers for the custom Player object and permissions. """ import datetime from django.db import models from django.contrib.auth.models import User from src.typeclasses.managers import returns_typeclass_list, returns_typeclass, TypedObjectManager from src.utils import logger # # Player Manager # def returns...
Python
""" Player The Player class is a simple extension of the django User model using the 'profile' system of django. A profile is a model that tack new fields to the User model without actually editing the User model (which would mean hacking into django internals which we want to avoid for future compatability reasons). ...
Python
""" Typeclass for Player objects Note that this object is primarily intended to store OOC information, not game info! This object represents the actual user (not their character) and has NO actual precence in the game world (this is handled by the associated character object, so you should customize that instead fo...
Python
""" This module provides a set of permission lock functions for use with Evennia's permissions system. To call these locks, make sure this module is included in the settings tuple PERMISSION_FUNC_MODULES then define a lock on the form '<access_type>:func(args)' and add it to the object's lockhandler. Run the access(...
Python
# -*- coding: utf-8 -*- """ This is part of Evennia's unittest framework, for testing the stability and integrrity of the codebase during updates. This module tests the lock functionality of Evennia. """ try: # this is a special optimized Django version, only available in current Django devel from django.u...
Python
""" Locks A lock defines access to a particular subsystem or property of Evennia. For example, the "owner" property can be impmemented as a lock. Or the disability to lift an object or to ban users. A lock consists of two three parts: - access_type - this defines what kind of access this lock regulates. This ju...
Python
""" A typeclass is the companion of a TypedObject django model. It 'decorates' the model without actually having to add new fields to the model - transparently storing data onto its associated model without the admin/user just having to deal with a 'normal' Python class. The only restrictions is that the typeclass must...
Python
""" This is the *abstract* django models for many of the database objects in Evennia. A django abstract (obs, not the same as a Python metaclass!) is a model which is not actually created in the database, but which only exists for other models to inherit from, to avoid code duplication. Any model can import and inherit...
Python
""" This implements the common managers that are used by the abstract models in dbobjects.py (and which are thus shared by all Attributes and TypedObjects). """ from django.db import models from src.utils import idmapper #from src.typeclasses import idmap # Managers class AttributeManager(models.Manager): "Mana...
Python
# # This sets up how models are displayed # in the web admin interface. # from src.scripts.models import ScriptAttribute, ScriptDB from django.contrib import admin class ScriptAttributeInline(admin.TabularInline): model = ScriptAttribute fields = ('db_key', 'db_value') max_num = 1 class ScriptDBAdm...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ScriptAttribute' db.create_table('scripts_scriptattribute', ( ('id', self.gf('...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'ScriptDB.db_lock_storage' db.alter_column('scripts_scriptdb', 'db_lock_storage', self.gf...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'ScriptAttribute.db_mode' from src.scripts.models import ScriptAttribute from sr...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding index on 'ScriptDB', fields ['db_key'] db.create_index('scripts_scriptdb', ['db_key']) #...
Python
""" The custom manager for Scripts. """ from src.typeclasses.managers import TypedObjectManager from src.typeclasses.managers import returns_typeclass_list VALIDATE_ITERATION = 0 class ScriptManager(TypedObjectManager): """ ScriptManager get methods """ @returns_typeclass_list def get_all_scripts...
Python
""" Scripts are entities that perform some sort of action, either only once or repeatedly. They can be directly linked to a particular Evennia Object or be stand-alonw (in the latter case it is considered a 'global' script). Scripts can indicate both actions related to the game world as well as pure behind-the-scenes e...
Python
""" This module contains the base Script class that all scripts are inheriting from. It also defines a few common scripts. """ from time import time from twisted.internet.defer import maybeDeferred from twisted.internet.task import LoopingCall from twisted.internet import task from src.server.sessionhandler import...
Python
""" The script handler makes sure to check through all stored scripts to make sure they are still relevant. An scripthandler is automatically added to all game objects. You access it through the property 'scripts' on the game object. """ from src.scripts.models import ScriptDB from src.utils import create from src....
Python
# # This sets up how models are displayed # in the web admin interface. # from django.contrib import admin from src.comms.models import Channel, Msg, PlayerChannelConnection, ExternalChannelConnection class MsgAdmin(admin.ModelAdmin): list_display = ('id', 'db_date_sent', 'db_sender', 'db_recei...
Python
""" The channel handler handles the stored set of channels and how they are represented against the cmdhandler. If there is a channel named 'newbie', we want to be able to just write > newbie Hello! For this to work, 'newbie', the name of the channel, must be identified by the cmdhandler as a command name. The chann...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'ExternalChannelConnection.db_external_path' db.delete_column('comms_externalchannelconne...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Channel.db_lock_storage' db.alter_column('comms_channel', 'db_lock_storage', self.gf('dj...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): #depends_on = ( # ("players", "0001_initial"), # ("comms", "0001_initial"), #) def forwards(self, orm): # Adding model 'Msg'...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ExternalChannelConnection' db.create_table('comms_externalchannelconnection', ( ...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding index on 'Channel', fields ['db_key'] db.create_index('comms_channel', ['db_key']) def back...
Python
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): # fixes a changed syntax in the locks. def forwards(self, orm): "Write your forwards methods here." for channel in orm.Channel.objects.all(...
Python
""" Models for the comsystem. The comsystem's main component is the Message, which carries the actual information between two parties. Msgs are stored in the database and usually not deleted. A Msg always have one sender (a user), but can have any number targets, both users and channels. Channels are central objects...
Python
""" IMC2 client module. Handles connecting to and communicating with an IMC2 server. """ from time import time from twisted.application import internet from twisted.internet import protocol from twisted.conch import telnet from django.conf import settings from src.utils import logger, create, search, utils from src.s...
Python
""" This connects to an IRC network/channel and launches an 'bot' onto it. The bot then pipes what is being said between the IRC channel and one or more Evennia channels. """ from twisted.application import internet from twisted.words.protocols import irc from twisted.internet import protocol from django.conf i...
Python
""" Certain periodic packets are sent by connected MUDs (is-alive, user-cache, etc). The IMC2 protocol assumes that each connected MUD will capture these and populate/maintain their own lists of other servers connected. This module contains stuff like this. """ from time import time class IMC2Mud(object): ...
Python
""" This module handles some of the -reply packets like whois-reply. """ from src.objects.models import ObjectDB from src.comms.imc2lib import imc2_ansi def handle_whois_reply(packet): """ When the player sends an imcwhois <playername> request, the outgoing packet contains the id of the one aski...
Python
""" ANSI parser - this adds colour to text according to special markup strings. This is a IMC2 complacent version. """ import re from src.utils import ansi class IMCANSIParser(ansi.ANSIParser): """ This parser is per the IMC2 specification. """ def __init__(self): normal = ans...
Python
""" IMC2 packets. These are pretty well documented at: http://www.mudbytes.net/index.php?a=articles&s=imc2_protocol """ import shlex from django.conf import settings class Lexxer(shlex.shlex): """ A lexical parser for interpreting IMC2 packets. """ def __init__(self, packet_str, posix=Tru...
Python
""" RSS parser for Evennia This connects an RSS feed to an in-game Evennia channel, sending messages to the channel whenever the feed updates. """ import re from twisted.internet import task from django.conf import settings from src.comms.models import ExternalChannelConnection, Channel from src.utils import log...
Python
""" These managers handles the """ import itertools from django.db import models from django.contrib.contenttypes.models import ContentType from src.utils.utils import is_iter class CommError(Exception): "Raise by comm system, to allow feedback to player when caught." pass # helper function def to_object(i...
Python
""" Evennia Line Editor Contribution - Griatch 2011 This implements an advanced line editor for editing longer texts in-game. The editor mimics the command mechanisms of the VI editor as far as possible. Features of the editor: undo/redo edit/replace on any line of the buffer search&replace text anywhere in bu...
Python
""" Evennia menu system. Contribution - Griatch 2011 This module offers the ability for admins to let their game be fully or partly menu-driven. Menu choices can be numbered or use arbitrary keys. There are also some formatting options, such a putting options in one or more collumns. The menu system consists of a ...
Python
""" Room Typeclasses for the TutorialWorld. """ import random from src.commands.cmdset import CmdSet from src.utils import create, utils from src.objects.models import ObjectDB from game.gamesrc.scripts.basescript import Script from game.gamesrc.commands.basecommand import Command from game.gamesrc.objects.baseobje...
Python
""" TutorialWorld - basic objects - Griatch 2011 This module holds all "dead" object definitions for the tutorial world. Object-commands and -cmdsets are also defined here, together with the object. Objects: TutorialObject Readable Obelisk LightSource CrumblingWall Weapon """ import time, random from src...
Python
""" This module implements a simple mobile object with a very rudimentary AI as well as an aggressive enemy object based on that mobile class. """ import random, time from django.conf import settings from src.objects.models import ObjectDB from src.utils import utils from game.gamesrc.scripts.basescript import Scr...
Python
""" This defines some generally useful scripts for the tutorial world. """ import random from game.gamesrc.scripts.basescript import Script #------------------------------------------------------------ # # IrregularEvent - script firing at random intervals # # This is a generally useful script for updating # object...
Python
""" Evennia Talkative NPC Contribution - Griatch 2011 This is a simple NPC object capable of holding a simple menu-driven conversation. Create it by creating an object of typeclass contrib.talking_npc.TalkingNPC, For example using @create: @create John : contrib.talking_npc.TalkingNPC Walk up to it and give th...
Python
""" Menu-driven login system Contribution - Griatch 2011 This is an alternative login system for Evennia, using the contrib.menusystem module. As opposed to the default system it doesn't use emails for authentication and also don't auto-creates a Character with the same name as the Player (instead assuming some so...
Python
""" Evennia misc commands Contribution - Griatch 2011 This module offers some miscellaneous commands that may be useful depending on the game you run or the style of administration you prefer. Alternatively they can be looked at for inspiration. To make available in the game, import this module to game.gamesrc.com...
Python
""" Contribution - Griatch 2011 This is a simple character creation commandset. A suggestion is to test this together with menu_login, which doesn't create a Character on its own. This shows some more info and gives the Player the option to create a character without any more customizations than their name (further o...
Python
#! /usr/bin/python # # Auto-generate reST documentation for Sphinx from Evennia source # code. # # Uses etinenned's sphinx autopackage script. Install it to folder # "autogen" in this same directory: # # hg clone https://bitbucket.org/etienned/sphinx-autopackage-script autogen # # Create a directory tree "code/" co...
Python
#! /usr/bin/python # # Converts Evennia's google-style wiki pages to reST documents # # Setting up to run: # # 1) From this directory, use SVN to download wiki2html converter by Chris Roos. Make sure # to download into a directory "wiki2html" like this: # # svn co http://chrisroos.googlecode.com/svn...
Python
""" This special Python config file sets the default encoding for the codebase to UTF-8 instead of ascii. This allows for just about any language to be used in-game. It is not advisable to change the value set below, as there will be a lot of encoding errors that result in server crashes. """ import sys sys.setdefau...
Python
#!/usr/bin/python # Importer script to convert Fineco xls files into QIF files, # for use, among others, by gnucash. # # Antonino Sabetta - antonino.sabetta@isti.cnr.it # (C) - 2009 # # This is based on Jelmer Vernooij's script # for PostBank mijn.postbank.nl .csv files. # Jelmer Vernooij <jelmer@samba.org>, 2007 imp...
Python
#!/usr/bin/python # Importer script to convert Fineco Credit Card xls files into QIF files, # for use, among others, by gnucash. # # Based on the fineo2qif.py script by # Antonino Sabetta - antonino.sabetta@isti.cnr.it # (C) - 2009 # # Modified by Marco Aicardi - marco [a] aicardi d0t org # # Released under GPLv3 Lice...
Python
#!/usr/bin/python from datetime import datetime from itertools import combinations, dropwhile from math import ceil from os.path import join from random import seed, shuffle from sys import argv try: from pygame import init as pyGameInit from pygame import Surface from pygame import NOFRAME from pygame...
Python
#!/usr/bin/python from datetime import datetime from itertools import combinations, dropwhile from math import ceil from os.path import join from random import seed, shuffle from sys import argv try: from pygame import init as pyGameInit from pygame import Surface from pygame import NOFRAME from pygame...
Python
import sys sys.path.append(r'bin') import wx, os, pylab, numpy, Neuron, tuningFunctions, tools, simulateData class findV1(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title, size=(300,200), style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE) ...
Python
#!/usr/bin/env python2.6 # -*- coding: utf-8 -*- import sys from future_builtins import * import cgi import getpass import json import re import time import urllib import httplib2 if len(sys.argv) == 1: username = raw_input('Username: ') password = getpass.getpass() elif len(sys.argv) == 2: username = s...
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