Skip to content

Instantly share code, notes, and snippets.

from socbot.pluginbase import Base
from twisted.application import internet
from twisted.web import resource, server
class Plugin(Base):
class Simple(resource.Resource):
isLeaf = True
def render_GET(self, request):
line = "<html><head><title>Ohai2</title></head><body>Hello, world 2!</body></html>"
self.log.info(line)
from socbot.pluginbase import Base
from twisted.application import internet
from twisted.web import resource, server
class Plugin(Base):
class Simple(resource.Resource):
isLeaf = True
def render_GET(self, request):
line = "<html><head><title>Ohai2</title></head><body>Hello, world 2!</body></html>"
self.log.info(line)
from socbot.pluginbase import Base
from twisted.application import internet
from twisted.web import resource, server
class Plugin(Base):
class Simple(resource.Resource):
isLeaf = True
def render_GET(self, request):
line = "<html><head><title>Ohai2</title></head><body>Hello, world 2!</body></html>"
self.log.info(line)
from inspect import getmembers, ismethod
import logging
from twisted.application import internet
from twisted.web import resource, server
from twisted.internet import reactor
class Base(object):
def __init__(self, manager):
self.manager = manager
self.log = logging.getLogger("plugin")
import os, sys
from subprocess import Popen
# java -cp "%APPDATA%\.minecraft\bin\*" -Djava.library.path="%APPDATA%\.minecraft\bin\natives" net.minecraft.client.Minecraft
appdata = os.path.dirname(os.path.abspath(__file__))
# java -cp ...
args = ['java', '-cp',]
import os, sys
from subprocess import Popen
# java -cp "%APPDATA%\.minecraft\bin\*" -Djava.library.path="%APPDATA%\.minecraft\bin\natives" net.minecraft.client.Minecraft
appdata = os.path.dirname(os.path.abspath(__file__))
# java -cp ...
args = ['java', '-cp',]
import urllib2
import subprocess
loginurl = "https://login.minecraft.net/?&user={0}&password={1}&version=9999"
user = "user"
pass_ = "pass"
loginurl = loginurl.format(user, pass_)
print "attempting login"
data = urllib2.urlopen(loginurl)
def launchUpdate(updated, user, ticket, appdata=None):
if appdata:
appdata = os.path.abspath(appdata)
if sys.platform == "win32":
os.putenv("APPDATA", appdata)
else:
os.environ["HOME"] = appdata
url = "minecraft.jar?user={0}&ticket={1}".format(user, ticket)
groups:
Admins:
permissions:
- '*'
inheritance:
default: false
Moderators:
permissions:
- worldguard.region.define
- worldguard.region.redefine
#!/usr/bin/env python
from PyQt4 import QtCore, QtGui
class GraphWidget(QtGui.QGraphicsView):
def __init__(self):
super(GraphWidget, self).__init__()
self.font = QtGui.QFont("System")
fontinfo = self.finfo = QtGui.QFontMetrics(self.font)