17.12.2012 Views

Programmation PYTHON - Zenk - Security - Repository

Programmation PYTHON - Zenk - Security - Repository

Programmation PYTHON - Zenk - Security - Repository

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

366<br />

La bibliothèque standard<br />

TROISIÈME PARTIE<br />

with f:<br />

line = None<br />

while line != '':<br />

if not self.running:<br />

return False<br />

line = f.readline(self.buffer)<br />

if ctext.match(line) is not None:<br />

return True<br />

return False<br />

#<br />

# Frames<br />

#<br />

class FramePath(Frame):<br />

def __init__(self, root):<br />

Frame.__init__(self)<br />

label = Label(self, text="Chemin de recherche")<br />

label.pack(fill=X, expand=1)<br />

self.path = Entry(self, name="path")<br />

self.path.pack(fill=BOTH)<br />

self.path.insert(0, os.path.expanduser('~'))<br />

self.path.select_range(0, END)<br />

class FrameText(Frame):<br />

def __init__(self, root):<br />

Frame.__init__(self)<br />

self.label = Label(self, text="Texte à rechercher")<br />

self.label.pack(fill=X, expand=1)<br />

self.text = Entry(self, name="text")<br />

self.text.pack(fill=BOTH)<br />

self.text.insert(0, '')<br />

self.text.select_range(0, END)<br />

class FrameButton(Frame):<br />

def __init__(self, root):<br />

Frame.__init__(self)<br />

def create_elements(self, stop_command, search_command,<br />

close_command):<br />

self.button = Button(self,text="Stop",<br />

command=stop_command)<br />

self.button.pack(side=RIGHT, padx=5, pady=5)<br />

self.button = Button(self,text="Rechercher",<br />

command=search_command)<br />

self.button.pack(side=RIGHT, padx=5, pady=5)<br />

self.button3 = Button(self,text="Fermer",<br />

command=close_command)<br />

self.button3.pack(side=RIGHT)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!