code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... | Python |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... | Python |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... | Python |
# This file is part of Androguard.
#
# Copyright (C) 2010, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... | Python |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... | Python |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... | Python |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... | Python |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... | Python |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... | Python |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name = 'androguard',
version = '1.2',
packages = find_packages(),
scripts = ['androaxml.py', 'androcsign.py', 'androdiff.py', 'androgexf.py',
'androlyze.py', 'andromercury.py', 'androrisk.py', 'androsign.py',
... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
f = open("permi", "r")
b = f.readlines()
f.close()
for i in b :
v = i.split(" ")
if len(v) > 2 :
buff = ' '.join( j for j in v[3:] )
buff = buff[:-1]
j = 0
while j < len(buff) and buff[j] == ' ' :
j += 1
buff = buff[j:]
if ... | Python |
#!/usr/bin/env python
from xml.dom import minidom
MANIFEST = "tools/permissions/AndroidManifest.xml"
STRINGS = "tools/permissions/strings.xml"
manifest_document = minidom.parse( MANIFEST )
strings_document = minidom.parse( STRINGS )
dstrings = {}
for i in strings_document.getElementsByTagName( "string" ) :
try ... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2010, Anthony Desnos <desnos at t0t0.org>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation... | Python |
PERMISSIONS_BY_HAND = {
"SEND_SMS" : { "android.telephony.SmsManager" : [
[ "F", "getDefault()", "static SmsManager" ],
[ "F", "sendDataMessage(java.lang.String, java.lang.String, short, byte[], PendingIntent, PendingIntent)", "void" ],
# [ "F",... | Python |
PERMISSIONS = {
"BIND_DEVICE_ADMIN" : {
"android.app.admin.DeviceAdminReceiver" : [
["C","ACTION_DEVICE_ADMIN_ENABLED","public static final String"],
],
},
"FACTORY_TEST" : {
"android.content.pm.ApplicationInfo" : [
["C","FLAG_FACTORY_TEST","public static final i... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2010, Anthony Desnos <desnos at t0t0.org>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation... | Python |
#!/usr/bin/env python
import sys, hashlib
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL)
from androguard.core.androgen import AndroguardS
from androguard.core.analysis import analysis
#TEST = 'examples/java/test/orig/Test1.class'
#TEST = 'examples/java/Demo1/orig/DES.class'
#TEST = 'examples/java/Demo1/orig/U... | Python |
#!/usr/bin/env python
import sys, os
import cProfile
# http://code.activestate.com/recipes/286222-memory-usage/
_proc_status = '/proc/%d/status' % os.getpid()
_scale = {'kB': 1024.0, 'mB': 1024.0*1024.0,
'KB': 1024.0, 'MB': 1024.0*1024.0}
def _VmB(VmKey):
global _proc_status, _scale
# get pseudo ... | Python |
#!/usr/bin/env python
import sys, random, string
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "/core")
sys.path.append(PATH_INSTALL + "/core/bytecodes")
import jvm
TEST = "./examples/java/test/orig/Test1.class"
TEST_REF = "./examples/java/Hello.class"
TEST_OUTPUT = "./examples/java/test/new/Test1.class"
j = ... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "./")
from androguard.core.androgen import AndroguardS
TEST = [ './examples/java/Hello.class' ]
_a = AndroguardS( TEST[0] )
_a.show()
for field in _a.gets("fields") :
print field.get_name(), field.get_descriptor()
for method ... | Python |
#!/usr/bin/env python
import hashlib
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "./")
from androguard.core.androgen import Androguard
def hexdump(src, length=8, off=0):
result = []
digits = 4 if isinstance(src, unicode) else 2
for i in xrange(0, len(src), length):
s = src[i:i+... | Python |
#!/usr/bin/env python
import sys, random, string
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "/core")
sys.path.append(PATH_INSTALL + "/core/bytecodes")
import jvm
TEST = "./examples/java/test/orig/Test1.class"
TEST_REF = "./examples/java/Hello.class"
TEST_OUTPUT = "./examples/java/test/new/Test1.class"
j = ... | Python |
#!/usr/bin/env python
import sys
import hashlib
import pyDes
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "./")
sys.path.append(PATH_INSTALL + "/core")
sys.path.append(PATH_INSTALL + "/core/bytecodes")
sys.path.append(PATH_INSTALL + "/core/analysis")
from androguard import *
import analysis
TEST = "./geinimi... | Python |
#!/usr/bin/env python
import sys, hashlib
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "./")
from androguard.core.androgen import AndroguardS
from androguard.core.analysis import analysis
OUTPUT = "./output/"
#TEST = 'examples/java/test/orig/Test1.class'
#TEST = 'examples/java/Demo1/orig/DES.class'
#TEST = ... | Python |
#!/usr/bin/env python
import sys, hashlib
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL)
from androguard.core.androgen import AndroguardS
from androguard.core.analysis import analysis
#TEST = 'examples/java/test/orig/Test1.class'
#TEST = 'examples/java/Demo1/orig/DES.class'
#TEST = 'examples/java/Demo1/orig/... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL)
from androguard.core.bytecodes import dvm
from androguard.core.analysis import analysis
TEST = "examples/android/TestsAndroguard/bin/classes.dex"
j = dvm.DalvikVMFormat( open(TEST).read() )
x = analysis.VMAnalysis( j )
j.set_vmanaly... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
import sys, random, string
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "/core")
sys.path.append(PATH_INSTALL + "/core/bytecodes")
import jvm
TEST = "./examples/java/test/orig/Test1.class"
TEST_OUTPUT = "./examples/java/test/new/Test1.class"
j = jvm.JVMFormat( open(TEST).read() )
# Mod... | Python |
#!/usr/bin/env python
import sys, random, string
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL)
from androguard.core.bytecodes import dvm
TEST = "./examples/dalvik/test/bin/classes.dex"
TEST_OUTPUT = "./examples/dalvik/test/bin/classes_output.dex"
j = dvm.DalvikVMFormat( open(TEST).read() )
# Modify the name o... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "./")
from androguard.core.androgen import Androguard, OBFU_Names, OBFU_NAMES_FIELDS, OBFU_NAMES_METHODS
TEST = [ './examples/java/test/orig/Test1.class', './examples/java/test/orig_main/Test.class' ]
TEST_OUTPUT = [ './examples/java... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "./core/vm")
sys.path.append(PATH_INSTALL + "./core/predicates")
from il_reil import VM_REIL, REIL_REGISTER, REIL_LITERAL, REIL_OFFSET, REIL_SUB, REIL_STRING
x = "HELLO WORLD"
var_j = REIL_REGISTER( "j", 4, 0 )
lit_1 = REIL_LITERAL... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "/core")
sys.path.append(PATH_INSTALL + "/core/bytecodes")
import jvm
TEST = "./examples/java/test/orig/Test1.class"
j = jvm.JVMFormat( open(TEST).read() )
# SHOW CLASS (verbose)
j.show()
# SHOW FIELDS
for i in j.get_fields() :
... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "./")
from androgen import Androguard
CONF1 = "./examples/java/Demo1/androguard_1.xml"
BASE_TEST = "./examples/java/Demo1/orig/"
BASE_TEST_OUTPUT = "./examples/java/Demo1/new/"
BASE_MAIN_TEST = "./examples/java/Demo1/orig_main/"
BA... | Python |
#!/usr/bin/env python
import random, string
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "./")
from androguard.core.androgen import AndroguardS
TEST = './examples/java/test/orig/Test1.class'
TEST_OUTPUT = './examples/java/test/new/Test1.class'
TEST2 = './examples/java/Hello.class'
_a = Androguard... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append( PATH_INSTALL )
from androguard.core.bytecodes import dvm, apk
TEST = "./examples/android/TC/bin/TC-debug.apk"
a = apk.APK( TEST )
a.show()
j = dvm.DalvikVMFormat( a.get_dex() )
# SHOW CLASS (verbose)
#j.show()
| Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "/core")
sys.path.append(PATH_INSTALL + "/core/bytecodes")
sys.path.append(PATH_INSTALL + "/core/analysis")
import jvm, analysis
TEST = "./examples/java/test/orig/Test1.class"
j = jvm.JVMFormat( open(TEST).read() )
x = analysis.VMA... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL)
from androguard.core.bytecodes import apk
from xml.dom import minidom
ap = apk.AXMLPrinter( open("examples/axml/AndroidManifest2.xml", "r").read() )
print minidom.parseString( ap.getBuff() ).toxml()
| Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL)
from androguard.core.androgen import AndroguardS
from androguard.core.analysis import analysis
#TEST = 'examples/java/test/orig/Test1.class'
TEST = 'examples/android/TestsAndroguard/bin/classes.dex'
a = AndroguardS( TEST )
x = anal... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL + "/core")
sys.path.append(PATH_INSTALL + "/core/bytecodes")
sys.path.append(PATH_INSTALL + "/core/assembly/")
sys.path.append(PATH_INSTALL + "/core/assembly/libassembly")
import assembly
assembly.ASM()
#import arm
#arm.ARM()
#a = ap... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL)
from androguard.core.bytecodes import dvm
TEST = "./examples/dalvik/test/bin/classes.dex"
j = dvm.DalvikVMFormat( open(TEST).read() )
# SHOW CLASS (verbose)
j.show()
# SHOW FIELDS
for i in j.get_fields() :
print i.get_access(),... | Python |
#!/usr/bin/env python
import sys
PATH_INSTALL = "./"
sys.path.append(PATH_INSTALL)
from androguard.core.bytecodes import dvm
from androguard.core.analysis import analysis
from androguard.decompiler import decompiler
TEST = "examples/android/TestsAndroguard/bin/classes.dex"
j = dvm.DalvikVMFormat( open(TEST).read()... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation,... | Python |
#! /usr/bin/env python
# coding=utf-8
pre_fix = 'controllers.'
urls = (
'/', pre_fix + 'fseek.index',
'/(?:img|js|css)/.*',pre_fix + 'static.static',
'/test', pre_fix + 'test.index',
'/googlea603dc71a8655358.html', pre_fix + 'test.google',
'/robots.txt', pre_fix +... | Python |
#!/usr/bin/env python
# coding: utf-8
import os
import web
#如果是在本地调试,请打开此开关,如果上传到sae,请置为False
LOCAL_DEBUG = True
if LOCAL_DEBUG:
templates_root = 'templates'
else:
import sae
app_root = os.path.dirname(__file__)
templates_root = os.path.join(app_root, '../templates')
render = web.template.render... | Python |
#! /usr/bin/env python
# coding=utf-8
pre_fix = 'controllers.'
urls = (
'/', pre_fix + 'fseek.index',
'/(?:img|js|css)/.*',pre_fix + 'static.static',
'/test', pre_fix + 'test.index',
'/googlea603dc71a8655358.html', pre_fix + 'test.google',
'/robots.txt', pre_fix +... | Python |
#!/usr/bin/env python
# coding: utf-8
import os
import web
#如果是在本地调试,请打开此开关,如果上传到sae,请置为False
LOCAL_DEBUG = True
if LOCAL_DEBUG:
templates_root = 'templates'
else:
import sae
app_root = os.path.dirname(__file__)
templates_root = os.path.join(app_root, '../templates')
render = web.template.render... | Python |
#! /usr/bin/env python
#coding=utf-8
import web
from config.urls import urls
app = web.application(urls, globals())
if __name__ == "__main__":
app.run()
| Python |
#! /usr/bin/env python
#coding=utf-8
from config.urls import urls
from config import settings
import os
import web
import sae
def notfound():
render = settings.render
return web.notfound(render.notfound())
app = web.application(urls, globals())
app.notfound = notfound
application = sae.create_ws... | Python |
#! /usr/bin/env python
#coding=utf-8
import web
from config.urls import urls
app = web.application(urls, globals())
if __name__ == "__main__":
app.run()
| Python |
#! /usr/bin/env python
#coding=utf-8
from config.urls import urls
from config import settings
import os
import web
import sae
def notfound():
render = settings.render
return web.notfound(render.notfound())
app = web.application(urls, globals())
app.notfound = notfound
application = sae.create_ws... | Python |
# Author: Alex Ksikes
import web
import mimetypes
class static:
def GET(self):
public_dir = 'static'
try:
file_name = web.ctx.path.split('/')[-1]
web.header('Content-type', mime_type(file_name))
return open(public_dir + web.ctx.path, 'rb').read()
excep... | Python |
#! /usr/bin/env python
#coding=utf-8
import time
import urllib2
import web
from web import form
from config.settings import render
from flib.geturl import FetchYKURL
vurl = form.regexp(r'http://.*youku.com/v_show/*', '目前仅支持"http://v.youku.com/v_show/"类地址')
url_form = form.Form(form.Textbox('userurl', form.... | Python |
import web
import mimetypes
import urllib2
from config.settings import render
class index:
def GET(self):
return render.test(urllib2.urlopen("http://www.baidu.com").geturl())
| Python |
#! /usr/bin/env python
#coding=utf-8
import time
import urllib2
import web
from web import form
from config.settings import render
from flib.geturl import FetchYKURL
vurl = form.regexp(r'http://.*youku.com/v_show/*', '目前仅支持"http://v.youku.com/v_show/"类地址')
url_form = form.Form(form.Textbox('userurl', form.... | Python |
#! /usr/bin/env python
#coding=utf-8
import json
import math
import random
import time
import urllib2
class FetchYKURL:
"""获取优库视频地址"""
def __init__(self, url):
#首先判断一下是不是有效的视频地址
self.url = url
def _read_json(self, url):
page = urllib2.urlopen(url).read(... | Python |
#! /usr/bin/env python
#coding=utf-8
import json
import math
import random
import time
import urllib2
class FetchYKURL:
"""获取优库视频地址"""
def __init__(self, url):
#首先判断一下是不是有效的视频地址
self.url = url
def _read_json(self, url):
page = urllib2.urlopen(url).read(... | Python |
print 'Content-Type: text/plain'
print ''
print 'You probably want /tetris ...'
| Python |
import cgi
import datetime
import urllib
import wsgiref.handlers
import random
import datetime
from django.utils import simplejson
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
class Score(db.Model):
name=db.StringProperty()
... | Python |
#!/usr/bin/env python
# Copyright (c) 2006 Damien Miller <djm@mindrot.org>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | Python |
#!/usr/bin/env python
# Copyright (c) 2006 Damien Miller <djm@mindrot.org>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | Python |
#!/usr/bin/env python
"""
A simple example of an animated plot in tkagg
"""
import time
import numpy as np
import matplotlib
matplotlib.use('TkAgg') # do this before importing pylab
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
def animate():
tstart = time.time() ... | Python |
#!/usr/bin/env python
"""
A simple example of an animated plot in tkagg
"""
import time
import numpy as np
import matplotlib
matplotlib.use('TkAgg') # do this before importing pylab
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
def animate():
tstart = time.time() ... | Python |
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show() | Python |
import pygame
import serial
import time
import string
from pygame.joystick import Joystick
#pygame init
pygame.init()
pygame.joystick.init()
try:
j = Joystick(0) # create a joystick instance
j.init() # init instance
print 'Enabled joystick: ' + j.get_name()
except pygame.error:
print 'no joystick f... | Python |
from pygame.joystick import Joystick
import pygame
import serial
import math
import string
import time
#from numpy.ma.core import floor
#pygame init
pygame.init()
pygame.joystick.init()
try:
j = Joystick(0) # create a joystick instance
j.init() # init instance
print 'Enabled joystick: ' + j.get_name... | Python |
'''
Created on Nov 25, 2010
@author: Polido
'''
class Angle(object):
'''
classdocs
'''
def __init__(self, p, y, r):
'''
Constructor
'''
self.p = p
self.y = y
self.r = r
def __str__(self):
return 'Angle({0}, {1}, {2})... | Python |
'''
Created on Dec 29, 2010
@author: Nican
'''
import threading
class MyThread ( threading.Thread ):
def run ( self ):
print 'Insert some thread stuff here.'
print 'It\'ll be executed...yeah....'
print 'There\'s not much to it.'
if __name__ == '__main__':
MyThrea... | Python |
'''
Created on Nov 25, 2010
@author: Polido
'''
import octorotor.ui
import wx
if __name__ == '__main__':
app = wx.App(False)
frame = octorotor.ui.MainWindow(None)
app.MainLoop()
| Python |
'''
Created on Nov 25, 2010
@author: Polido
'''
import pygame
from pygame.joystick import Joystick
from octorotor.joystick.JoystickData import JoystickData
#pygame init
pygame.init()
pygame.joystick.init()
class Controller(object):
'''
classdocs
'''
def __init__(self):
'... | Python |
'''
Created on Nov 25, 2010
@author: Polido
'''
from Angle import Angle
class JoystickData(object):
'''
classdocs
'''
def __init__(self, joystick, stop):
'''
Constructor
'''
self.angle = Angle(
joystick.get_axis(3),
... | Python |
import wx
from wx.glcanvas import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GL import *
from time import time
import sys,math
name = 'ball_glut'
class myGLCanvas(GLCanvas):
def __init__(self, parent):
GLCanvas.__init__(self, parent,-1)
wx.EVT_PAINT(self, self.On... | Python |
'''
Created on Nov 25, 2010
@author: Polido
'''
import Angle
from time import time
from octorotor.joystick.JoystickData import JoystickFakeData
class DataPoint(object):
'''
classdocs
'''
def byteToAngle(self, byte):
return byte / 255.0 * 360.0
def IsValid(self... | Python |
'''
Created on Dec 29, 2010
@author: Nican
'''
import pygame
import Octorotor
import threading
class OctoThread(threading.Thread):
'''
classdocs
'''
def __init__(self, port, baudRate):
threading.Thread.__init__(self)
'''
Constructor
'''
... | Python |
'''
Created on Dec 5, 2010
@author: Wd
'''
fibbo = [1,1,3,5,8,13,21,34]
data = fibbo + [5,1,2,3,4]
baddata = [255,255,255] + data
def correctIntroduction(data):
return fibbo == data[0:len(fibbo)]
def getData(data):
while len(data) > len(fibbo):
if correctIntroduction(data):
... | Python |
'''
Created on Nov 26, 2010
@author: Polido
'''
introSequence = [8, 13, 21, 34]
class SerialReader(object):
'''
classdocs
'''
def __init__(self, octorotor):
'''
Constructor
'''
self.octorotor = octorotor
self.dataBuffer = []
def ... | Python |
'''
Created on Nov 25, 2010
@author: Polido
'''
import serial
import math
class Serial(object):
'''
classdocs
'''
def __init__(self, port, baudrate):
'''
Constructor
'''
self.portName = port
self.baudRate = baudrate
self... | Python |
'''
Created on Dec 22, 2010
@author: Nican
'''
class ISettingRequest():
def __init__(self):
pass
def getRollPitchValue(self):
raise Exception('getRollPitchValue not implemented')
def getYawValue(self):
raise Exception('getYawValue not implemented') | Python |
'''
Created on Nov 25, 2010
@author: Polido
'''
from octorotor.Serial import Serial
import octorotor.joystick.Controler as Controler
from octorotor.SerialReader import SerialReader
from octorotor import DataPoint
from time import time
class Octorotor(object):
'''
classdocs
'''
def __i... | Python |
'''
Created on Dec 24, 2010
@author: Nican
'''
import serial
from time import time
s = serial.Serial(port='COM6', baudrate=57600, timeout=1)
nextTime = 0
count = 0
if __name__ == '__main__':
while 1:
if s.inWaiting() > 4:
s.flushInput()
... | Python |
'''
Created on Dec 22, 2010
@author: Nican
'''
from octorotor.SettingRequest import ISettingRequest
class UISettingRequest(ISettingRequest):
'''
classdocs
'''
def __init__(self, rollslider, yawslider):
'''
Constructor
'''
ISettingRequest.__init__(self... | Python |
'''
Created on Dec 4, 2010
@author: Nican
'''
import math
import wx
class Gauge(wx.Window):
def __init__(self, parent, name, color):
sty = wx.NO_BORDER
wx.Window.__init__(self, parent, style=sty)
self.parent = parent
self.SetBackgroundColour(wx.WHITE)
self... | Python |
'''
Created on Dec 4, 2010
@author: Nican
'''
from octorotor.ui import scanwin32
import wx
class MenuBar(wx.MenuBar):
'''
classdocs
'''
ValueSaver = None
def __init__(self):
'''
Constructor
'''
wx.MenuBar.__init__(self)
... | Python |
import ctypes
import re
def ValidHandle(value):
if value == 0:
raise ctypes.WinError()
return value
NULL = 0
HDEVINFO = ctypes.c_int
BOOL = ctypes.c_int
CHAR = ctypes.c_char
PCTSTR = ctypes.c_char_p
HWND = ctypes.c_uint
DWORD = ctypes.c_ulong
PDWORD = ctypes.POINTER(DWORD)
ULONG = ctypes.c_ulong
ULONG... | Python |
'''
Created on Dec 22, 2010
@author: Nican
'''
import wx
class ValueSlider(wx.BoxSizer):
'''
classdocs
'''
ValueSaver = None
def __init__(self, parent, id, name, saveName):
'''
Constructor
'''
wx.BoxSizer.__init__(self, wx.VERTICAL)
... | Python |
'''
Created on Dec 23, 2010
@author: Nican
'''
import wx
import octorotor.joystick.Controler as Controler
class JoystickValues(wx.BoxSizer):
'''
classdocs
'''
def __init__(self, parent):
'''
Constructor
'''
wx.BoxSizer.__init__(self, wx.VERTICAL)... | Python |
from octorotor.ui.Gauge import Gauge
from octorotor.ui.Graph import Graph
from octorotor.ui.MenuBar import MenuBar
from octorotor.ui.StartMenu import StartMenu
import wx.lib.newevent
from octorotor import Octorotor, OctorotorThread
from ValueSlider import *
import time
from octorotor.ui.UISettingRequest import ... | Python |
'''
Created on Dec 4, 2010
@author: Nican
'''
import wx.lib.plot as plot
class Graph(plot.PlotCanvas):
'''
classdocs
'''
def __init__(self, parent):
'''
Constructor
'''
plot.PlotCanvas.__init__(self, parent)
def Gr... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.