Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
soumya
Swecha Project 1
Commits
5667ce2e
Commit
5667ce2e
authored
May 27, 2014
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search app
parent
42e1f37d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
src/1.py
src/1.py
+42
-0
No files found.
src/1.py
0 → 100644
View file @
5667ce2e
from
PyQt4
import
QtGui
import
sys
def
search_files
():
searchstr
=
search_edit
.
text
()
dict_data
=
open
(
'dict.json'
)
dictionary
=
json
.
load
(
dict_data
)
files_data
=
open
(
'filemap.json'
)
fileList
=
json
.
load
(
files_data
)
found
=
0
for
wordlist
in
dictionary
:
if
searchstr
==
wordlist
[
0
]:
label
.
setText
(
"%s is found in "
%
(
searchstr
))
for
match
in
wordlist
[
1
:]:
label
.
setText
(
"%s "
%
(
fileList
[
match
]))
found
=
1
break
if
found
==
0
:
label
.
setText
(
"Unable to find %s"
%
(
searchstr
))
dict_data
.
close
()
files_data
.
close
()
#########################
app
=
QtGui
.
QApplication
(
sys
.
argv
)
w
=
QtGui
.
QWidget
()
w
.
setWindowTitle
(
"Team 1 SEARCH APP"
)
hbox1
=
QtGui
.
QHBoxLayout
()
label
=
QtGui
.
Qlabel
(
"Search"
)
search_edit
=
QtGui
.
QLineEdit
()
clik_button
=
QtGui
.
QPushButton
(
"Clik Here"
)
clik_button
.
clicked
.
connect
(
search_files
)
#icon should be added
hbox1
.
addWidget
(
label
)
hbox1
.
addWidget
(
search_edit
)
#button should be added
hbox1
.
addWidget
(
clik_button
)
w
.
setlayout
(
hbox1
)
w
.
show
()
sys
.
exit
(
app
.
exec_
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment