Skip to content
This repository was archived by the owner on Jul 8, 2018. It is now read-only.

Commit abc9362

Browse files
committed
add new style
1 parent bf1546d commit abc9362

File tree

10 files changed

+66240
-59307
lines changed

10 files changed

+66240
-59307
lines changed

AboutBox.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,18 @@ class CodeHuntersBox(QMessageBox):
66
def __init__(self, parent=None):
77
super(CodeHuntersBox, self).__init__(parent=parent)
88
self.setIconPixmap(QPixmap(":codehunters"))
9-
self.setStyleSheet("QLabel{min-width:300 px;} QPushButton{ width:250px; font-size: 18px; }")
9+
self.setStyleSheet("QLabel{min-width:300 px;}")
1010
urlgithub = 'https://github.com/CodeHuntersLab'
1111
urlfacebook = 'https://www.facebook.com/CodeHuntersLab'
1212
text = "<H1>CodeHunters Lab</H1>" \
1313
"<p> Comunidad que desarrolla actividades orientadas a la formación en investigación y" \
1414
" creación tecnológica, dirigidas a jóvenes entre 15 y 20 años.</p> " \
1515
"<p>Búscanos en: </p>" \
16-
"<p><a href=\"{github}\"> <img src=\":github\" height=\"20\" style=\"display:inline-block\"> " \
17-
"<span style=\" text-decoration: underline; color:#ff9e21;\"></p>" \
18-
"<p><a href=\"{facebook}\"> <img src=\":facebook\" height=\"20\" style=\"display:inline-block\"> " \
19-
"<span style=\" text-decoration: underline; color:#ff9e21;\"></p>" \
16+
"<p><a href=\"{github}\"> <img src=\":github\" height=\"20\"></a></p>" \
17+
"<p><a href=\"{facebook}\"> <img src=\":facebook\" height=\"20\"></a></p>" \
2018
.format(github=urlgithub, facebook=urlfacebook)
2119

22-
self.setInformativeText("Copyright: 2016 CodeHunters Lab")
20+
self.setInformativeText("© 2016 CodeHunters Lab")
2321
self.setText(text)
2422
self.setWindowTitle(self.tr("Acerca de CodeHunterLab"))
2523

Background.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from PyQt5.QtMultimedia import (QMediaContent, QMediaPlayer)
66
from PyQt5.QtWidgets import (qApp, QAction, QMessageBox, QWidget)
77
from gtts import gTTS
8-
# from wikipedia import wikipedia
8+
from wikipedia import wikipedia
99
from AboutBox import CodeHuntersBox
1010
from Atoms import Atoms
1111
from CuriButton import CuriButton, ElementButton
@@ -27,7 +27,7 @@ def __init__(self, parent=None):
2727

2828
side = 40
2929
self.setFixedSize(side * QSize(30, 15))
30-
self.setWindowIcon(QIcon(":codehunters"))
30+
self.setWindowIcon(QIcon(":curielements"))
3131

3232
region = QRegion(QRect(0, 0, 2 * side, 2 * side), QRegion.Ellipse)
3333
region += QRegion(QRect(side, 0, 8 * side, 15 * side))
@@ -53,11 +53,13 @@ def __init__(self, parent=None):
5353
x, y, name, symbol, electron, description, description2 = file.readLine().split(',')
5454
coordinate = QPoint(int(x), int(y))
5555

56-
text = "El {name} cuyo simbolo químico es {symbol} tiene {electron} electrones y protones. {description}" \
57-
.format(name=bytearray(name).decode(),
58-
symbol=self.getSymbol(bytearray(symbol).decode()),
59-
electron=bytearray(electron).decode(),
60-
description=" ")
56+
# text = "El {name} cuyo simbolo químico es {symbol} tiene {electron} electrones y protones. {description}" \
57+
# .format(name=bytearray(name).decode(),
58+
# symbol=self.getSymbol(bytearray(symbol).decode()),
59+
# electron=bytearray(electron).decode(),
60+
# description=" ")
61+
62+
text = bytearray(name).decode()
6163
btn = ElementButton(QSize(side, side), ":{number}.{symbol}.0"
6264
.format(symbol=bytearray(symbol).decode(),
6365
number=bytearray(electron).decode()),
@@ -68,8 +70,8 @@ def __init__(self, parent=None):
6870
btn.move(offset + coordinate * side)
6971
btn.clicked.connect(self.button_clicked)
7072
self.imageDescription = CuriButton(side * QSize(7, 4), "", QColor("#002e5b"), self)
71-
self.imageDescription.move(1.5*side, 9*side)
72-
btnSound = CuriButton(side*QSize(2, 2), ":soundOn", QColor("#002e5b"), self)
73+
self.imageDescription.move(1.5 * side, 9 * side)
74+
btnSound = CuriButton(side * QSize(2, 2), ":soundOn", QColor("#002e5b"), self)
7375
btnSound.move(11 * side, 12 * side)
7476
btnSound.clicked.connect(self.player.stop)
7577

@@ -81,12 +83,13 @@ def getSymbol(self, symbol):
8183

8284
def speak(self, name):
8385
self.player.stop()
84-
# wikipedia.set_lang("es")
85-
# text = wikipedia.summary(name)
86+
wikipedia.set_lang("es")
87+
text = wikipedia.summary(name, sentences=1)
8688
# print(text)
8789
filename = os.path.dirname(os.path.realpath(__file__)) + "/Curie.mp3"
8890
# os.remove(filename)
89-
tts = gTTS(text=name, lang='es')
91+
print(text)
92+
tts = gTTS(text=text, lang='es')
9093
tts.save(filename)
9194
media = QMediaContent(QUrl.fromLocalFile(filename))
9295
self.player.setMedia(media)
@@ -97,7 +100,7 @@ def button_clicked(self):
97100
self.atoms.update_number(self.sender().number)
98101
self.setImage(":{number}.{symbol}.2".format(symbol=self.sender().symbol,
99102
number=self.sender().number))
100-
# self.speak(self.sender().description)
103+
self.speak(self.sender().description)
101104

102105
def mousePressEvent(self, event):
103106
if event.button() == Qt.LeftButton:
@@ -125,4 +128,5 @@ def closeEvent(self, event):
125128
self.player.stop()
126129
super().closeEvent(event)
127130

131+
128132
import resource_rc

Curie.mp3

38.1 KB
Binary file not shown.

elements.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
4,6,Háfnio,Hf,72,OLA K ASE,OLA K ASE
1919
4,7,Rutherfordio,Rf,104,OLA K ASE,OLA K ASE
2020
5,4,Vanadio,V,23,OLA K ASE,OLA K ASE
21-
5,5,Nubidio,Nb,41,OLA K ASE,OLA K ASE
21+
5,5,Niobio,Nb,41,OLA K ASE,OLA K ASE
2222
5,6,Tantalio,Ta,73,OLA K ASE,OLA K ASE
2323
5,7,Dubnio,Db,105,OLA K ASE,OLA K ASE
2424
6,4,Cromo,Cr,24,OLA K ASE,OLA K ASE
@@ -29,7 +29,7 @@
2929
7,5,Tecnecio,Tc,43,OLA K ASE,OLA K ASE
3030
7,6,Renio,Re,75,OLA K ASE,OLA K ASE
3131
7,7,Bohrio,Bh,107,OLA K ASE,OLA K ASE
32-
8,4,Fierro,Fe,26,OLA K ASE,OLA K ASE
32+
8,4,Hierro,Fe,26,OLA K ASE,OLA K ASE
3333
8,5,Rubidio,Ru,44,OLA K ASE,OLA K ASE
3434
8,6,Osmio,Os,76,OLA K ASE,OLA K ASE
3535
8,7,Hassio,Hs,108,OLA K ASE,OLA K ASE

img/curiElements.png

66.5 KB
Loading

img/facebook.png

30.2 KB
Loading

img/github.png

11.5 KB
Loading

img/redes.zip

-4.67 KB
Binary file not shown.

resource.qrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<RCC>
22
<qresource prefix="/">
3-
<file alias="codehunters">img/codehunters.ico</file>
3+
<file alias="codehunters">img/codehunters.ico</file>
4+
<file alias="curielements">img/curiElements.png</file>
45
<file alias="background">img/background.png</file>
56
<file alias="close">img/close.png</file>
67
<file alias="qt">img/qt.png</file>

0 commit comments

Comments
 (0)