/
__init__.py
184 lines (144 loc) · 7.1 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# -*- coding: UTF-8 -*-
#TCASystemUtilities, Shut down and restart the PC with Windows classic sound, an Open system Options.
#Autor: Peter Reina<peterrc87@gmail.com><Tecnoconocimiento Accesible 2020>
# This file is covered by the GNU General Public License.
from scriptHandler import script
import api, keyboardHandler, globalPluginHandler, tones, ui, globalVars, addonHandler,winUser, gui
import subprocess, os, sys, threading
import webbrowser, wx
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from TCA_SU import t_fun as tsu
from TCA_SU import t_menu as tm
addonHandler.initTranslation()
class GlobalPlugin(globalPluginHandler.GlobalPlugin):
def __init__(self):
if globalVars.appArgs.secure:
return
super(GlobalPlugin, self).__init__()
self._MainWindows = None
#Barra de herramientas.
tm.create_menu(self)
def terminate(self):
try:
if not self._MainWindows:
self._MainWindows.Destroy()
except (AttributeError, RuntimeError):
pass
@script(description=_('Apagar el sistema'), category='TCA-SystemUtilities', gesture='kb:nvda+shift+a')
def script_TCAShut(self,gesture):
tsu.T_h(self,1)
@script(description=_('Reinicio del sistema'), category='TCA-SystemUtilities', gesture='kb:nvda+shift+r')
def script_TCAShutR(self,gesture):
tsu.T_h(self, 2)
@script(description=_('Anular apagado'), category='TCA-SystemUtilities', gesture='kb:nvda+0')
def script_TCAShutA(self,gesture):
tsu.T_h(self, 3)
@script(description= _('Abrir opciones de sonido'), category='TCA-SystemUtilities')
def script_TCAsndOp(self,gesture):
subprocess.Popen('mmsys.cpl', shell=True)
@script(description=_('Abrir carpeta Roaming'), category='TCA-SystemUtilities', gesture='kb:nvda+9')
def script_TCARoa(self,gesture):
os.startfile(os.path.join(os.environ['userprofile'], 'appdata', 'Roaming'))
@script(description=_('Abrir Asistente transferir archivos por Bluetooth'), category='TCA-SystemUtilities', gesture='kb:nvda+shift+9')
def script_TCAblue(self,gesture):
subprocess.Popen('fsquirt')
@script(description=_('Saber la arquitectura del sistema'), category='TCA-SystemUtilities')
def script_TCAar(self,gesture):
try:
os.environ['PROGRAMFILES(X86)']
version_sys=64
except:
version_sys=32
ui.message(_('Su sistema operativo es de: {} Bits').format(version_sys))
@script(description=_('Abrir el asistente para guardar la contraseña del sistema'), category='TCA-SystemUtilities')
def script_TCArcon(self,gesture):
ui.message(_('Abriendo restablecer contraseñas de Windows'))
subprocess.Popen('RunDll32.exe keymgr.dll,PRShowSaveWizardExW')
@script(description=_('Copiar al portapapeles la ruta'), category='TCA-SystemUtilities')
def script_TCAclip(self,gesture):
tsu.t_obj(self)
api.copyToClip('"{}"'.format(self.v_obj))
ui.message(_('Ruta copiada '))
@script(description= _('Abrir el administrador de discos'), category='TCA-SystemUtilities')
def script_TCAdisk(self,gesture):
subprocess.Popen('diskmgmt.msc', shell=True)
@script(description=_('Abrir la tienda oficial de complementos'), category='TCA-SystemUtilities', gesture='kb:nvda+x')
def script_TCAtien(self,gesture):
webbrowser.open_new_tab('https://addons.nvda-project.org/index.es.html')
@script(description=_('Abrir monitor de recursos'), category='TCA-SystemUtilities')
def script_TCAmon(self, gesture):
subprocess.Popen('resmon')
@script(description=_('Copiar al portapapeles la lista de carpetas y archivos'), category='TCA-SystemUtilities', gesture='kb:nvda+shift+l')
def script_TCAList(self, gesture):
tsu.T_h(self, 5)
@script(description=_('Saber la versión de Windows'), category='TCA-SystemUtilities')
def script_TCAver(self, gesture):
subprocess.Popen('winver')
@script(description=_('Abrir el administrador de dispositivoss'), category='TCA-SystemUtilities')
def script_TCAdispo(self,gesture):
subprocess.Popen('devmgmt.msc', shell=True)
@script(description=_('Abrir Opciones de carpeta'), category='TCA-SystemUtilities', gesture='kb:nvda+shift+0')
def script_TCAcar(self,gesture):
subprocess.Popen('control folders')
tones.beep(350,100)
@script(description=_('Hacer análisis del sistema Con SFC '), category='TCA-SystemUtilities')
def script_TCAsfc(self, gesture):
tsu.T_h(self, 6)
@script(description=_('Copiar información de todo el sistema al portapapeles'), category='TCA-SystemUtilities')
def script_TCAcopy_sys(self, gesture):
tsu.T_h(self, 4)
ui.message(_('información del sistema copiada al portapapeles'))
@script(description=_('Abrir mapa de caracteres'), category='TCA-SystemUtilities')
def script_TCAchar(self, gesture):
subprocess.Popen('charmap')
@script(description=_('Abrir Asistente guardar contraseñas de usuarios'), category='TCA-SystemUtilities', gesture='kb:nvda+shift+8')
def script_TCAa_usu(self, gesture):
subprocess.Popen('credwiz')
@script(description=_('Abrir opciones de voz'), category='TCA-SystemUtilities')
def script_TCAopvox(self, gesture):
subprocess.Popen(os.path.join(os.environ['systemroot'], 'system32', 'Speech', 'SpeechUX', 'sapi.cpl'), shell=True)
@script(description=_('Copiar al portapapeles la información sobre las tarjetas de sonido'), category='TCA-SystemUtilities')
def script_TCAcopitar(self, gesture):
tsu.T_h(self, 7)
@script(description=_('Ocultar carpetas'), category='TCA-SystemUtilities')
def script_TCAocu(self, gesture):
tsu.T_h(self, 8)
@script(description=_('Mostrar carpetas ocultas'), category='TCA-SystemUtilities')
def script_TCAmos(self, gesture):
tsu.T_h(self, 9)
@script(description=_('Limpiar disco'), category='TCA-SystemUtilities')
def script_TCAclean(self, gesture):
tsu.T_h(self, 10)
@script(description='Abrir Explorador Windows', category='TCA-SystemUtilities', gesture='kb:nvda+e')
def script_OpenEx(self,gesture):
os.system('explorer')
@script(description=_('Reiniciar Explorador'), category='TCA-SystemUtilities')
def script_TCAr_explo(self, gesture):
tsu.T_h(self, 11)
@script(description=_('Abrir Optimizar las unidades'), category='TCA-SystemUtilities')
def script_TCAoptim(self, gesture):
tsu.T_h(self, 12)
@script(description=_('Hibernar el sistema'), category='TCA-SystemUtilities')
def script_TCAhiber(self, gesture):
tsu.T_h(self, 13)
@script(description=_('Volumen'), category='TCA-SystemUtilities')
def script_TCAvolu(self, gesture):
fg = api.getForegroundObject()
obj = fg.children[5].children[2].children[0].children[7]
ui.message("el nombre es: {}".format(obj.name))
api.moveMouseToNVDAObject(obj)
keyboardHandler.KeyboardInputGesture.fromName("space").send()
os.chdir(tsu.a_path)
focus = api.getFocusObject()
focus = focus.parent
a = '''Red
Acceso a Internet'''
if focus.name ==a:
recButton = focus.parent.next.firstChild
api.moveMouseToNVDAObject(recButton)
winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN,0,0,None,None)
winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP,0,0,None,None)
#winsound.PlaySound("C:\Windows\Media\Windows Pop-up Blocked.wav", winsound.SND_FILENAME)
@script(description=_('Reparar sistema con Dism'), category='TCA-SystemUtilities')
def script_TCAa_dism(self, gesture):
tsu.T_h(self, 14)