Форум сайта python.su
INSTALLED_APPS = [ feincms,]
import datetime
import mptt
from django.db import models
from mptt.models import MPTTModel
class Adress(models.Model):
name_location = models.CharField(max_length=200, unique=True, verbose_name=_(u"name location"))
def __unicode__(self):
return (self.name_location)
mptt.register(Adress)
from django.contrib import admin
from feincms.admin import editor
from company.models import Departament,Adress,Personnel
from mptt.admin import MPTTModelAdmin
class AdressAdmin(editor.TreeEditor):
list_display = ('name_location',)
admin.site.register(Adress,AdressAdmin)
[28/Aug/2011 11:32:10] "GET /admin/company/adress/ HTTP/1.1" 200 11414
[28/Aug/2011 11:32:11] "GET /static/feincms/style.css HTTP/1.1" 404 5205
[28/Aug/2011 11:32:11] "GET /static/feincms/fein_tree.css HTTP/1.1" 404 5217
[28/Aug/2011 11:32:11] "GET /static/feincms/jquery-1.5.1.min.js HTTP/1.1" 404 5235
<VirtualHost *:80>
ServerName project.net
ServerAlias *.project.net
WSGIScriptAlias / "C:/Apache2.2/htdocs/project/app.wsgi"
DocumentRoot "C:/Apache2.2/htdocs/project"
ErrorLog "logs/pylogs.log"
ScriptAlias /cgi/ "C:/Apache2.2/cgi-bin/"
ScriptAlias /cgi-bin/ "C:/Apache2.2/cgi-bin/"
</VirtualHost>
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "C:\Python26\lib\lib-tk\Tkinter.py", line 498, in callit
self.deletecommand(name)
File "C:\Python26\lib\lib-tk\Tkinter.py", line 360, in deletecommand
self._tclCommands.remove(name)
AttributeError: 'NoneType' object has no attribute 'remove'
def __init__(self, app):
self.app=app
self.root_harm=Toplevel()
self.root_harm.focus_set()
self.root_harm.transient(self.app.root)
self.root_harm.protocol('WM_DELETE_WINDOW', self.close)
self.root_harm.grab_set()
text = self.txt.selection_get(selection='CLIPBOARD')
text = self.txt.clipboard_get()
numpy.delete(arr, obj, axis=None)
obj : slice, int or array of ints
Indicate which sub-arrays to remove.
>>> x
array([[1, 2, 3, 4, 5, 6],
[0, 2, 4, 6, 8, 1],
[1, 2, 1, 2, 1, 2]])
>>> delete(x,1,0)
array([[1, 2, 3, 4, 5, 6],
[1, 2, 1, 2, 1, 2]])
draw.arc((X1,Y,X2,Y2), ang1, ang2, fill=color)
import urllib2,urllib,cookielib
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener( opener )
params=urllib.urlencode({
'destination': urlparse.urljoin(self.domain, 'owa/'),
'flags': '0',
'username': username,
'password': password,
'SubmitCreds': 'Log On',
'forcedownlevel': '0',
'trusted': '4',
'isUtf8':'1',
})
f = opener.open( 'http://example.com/login/', params )
data = f.read()
print data
import time
import urllib
save_path = 'E:\Видео + Фильмы\X\\'
#http://ultravideo.in/mp/get/fid/9824/fn/x_files_the_(s2e01).avi
url_path = "http://ultravideo.in/mp/get/fid/9824/fn/"
i = 0x01;
while i <= 25:
if i >= 10:
file_name = "x_files_the_s2e" + str(i) + ".avi"
else:
file_name = "x_files_the_s2e0" +str(i) + ".avi"
urllib.urlretrieve(url_path+file_name,save_path+file_name)
print("Download %s and save to %s",url_path+file_name,save_path+file_name)
i = i + 1
quit()
Код Python
from distutils.core import setup
import py2exe
import sys
from glob import glob
data_files = [("Microsoft.VC90.CRT", glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*'))]
sys.path.append("C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\redist\\x86\\Microsoft.VC90.CRT")
setup(data_files=data_files, console=['test.py'])
import appuifw
import e32
import keypress
import os
import string
import appswitch
import graphics
import md5
regkey=[0, 0, 0]
def regkeyset(str):
return map(ord, str[0:3])
def regkey2ascii():
return string.joinfields(map(chr, regkey), "")
def regkeyincr():
regkey[0]+=1
if (regkey[0]>255):
regkey[1]+=1
regkey[0]=0
if (regkey[1]>255):
regkey[2]+=1
regkey[1]=0
def regkey2digit():
return 65536*regkey[2] + 256 * regkey[1]+ 1 * regkey[0]
def imgcomp(img1, img2):
size1=img1.size
size2=img2.size
if(size1 == size2):
#for x in xrange(size1[0]):
for x in xrange(45,75):
for y in xrange(size1[1]):
#for y in xrange(50, size1[1]):
if(img1.getpixel((x, y)) == img2.getpixel((x, y))):
continue
else:
return 0
return 1
else:
return 0
def exit():
appuif.app.set_exit
def sleep(seconds):
e32.ao_sleep(float(seconds))
def sim_key(code1, code2=0):
# keypress.simulate_key(code1, code2)
keypress.simulate_key_mod(code1, code2, 0)
sleep(0.01)
def stopping(key):
if (key == 63497):
os.abort()
def get_app_in_stack(index):
global log
try:
apps = appswitch.application_list(True) # true = include all
# false = no hidden apps
if index >= len(apps):
return u"!_index_error_!"
return str(apps[index])
except:
return u"!_getting_app_error_!"
appuifw.app.exit_key_handler = exit
import keycapture
capturer = keycapture.KeyCapturer(stopping)
capturer.forwarding = 1
capturer.keys = [63497]
capturer.start()
appuifw.note(u'Dlya ostanovki nazhmite BBEPX =>', 'info')
# o?p?ae??? peAc?a??
try:
bmp_file = open("C:\\Data\\Verysoft\\NiceAlarm\\nicealarm17.dat", "r+b")
except IOError, err:
print err.strerror
#appswitch.kill_app(u'X-plore')
buff = bmp_file.read()
regkey=regkeyset(buff)
bmp_file.close()
fl=0
while (regkey2digit() < 99999):
regkeyincr()
try:
bmp_file = open("C:\\Data\\Verysoft\\NiceAlarm\\nicealarm17.dat", "r+b")
except IOError, err:
print err.strerror
bmp_file.seek(0, 0)
bmp_file.write(regkey2ascii())
bmp_file.write(buff[3:])
bmp_file.close()
if get_app_in_stack(0) != u'NiceAlarm':
e32.start_exe('niceAlarm_0x20008998.exe', '', 0)
sleep(1)
sim_key(63554,63554)
sleep(0.05)
img2 = graphics.screenshot()
if (fl == 0):
img1 = img2
fl = 1
else:
if (not imgcomp(img1, img2)):
break
#else:
#appswitch.kill_app(u'NiceAlarm')
sim_key(63555,63555)
sleep(0.01)
sim_key(63555,63555)
sleep(0.01)
e32.reset_inactivity()