Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
c2ba8414
Commit
c2ba8414
authored
Apr 10, 2014
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified how the DTMF letter to digit mapping is computed
parent
67fbb869
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
sessions.py
blink/sessions.py
+3
-3
No files found.
blink/sessions.py
View file @
c2ba8414
...
@@ -14,7 +14,7 @@ import sys
...
@@ -14,7 +14,7 @@ import sys
from
collections
import
defaultdict
,
deque
from
collections
import
defaultdict
,
deque
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
from
functools
import
partial
from
functools
import
partial
from
itertools
import
chain
,
count
,
izip
,
repeat
from
itertools
import
chain
,
count
from
operator
import
attrgetter
from
operator
import
attrgetter
from
threading
import
Event
from
threading
import
Event
...
@@ -2214,8 +2214,8 @@ class AudioSessionListView(QListView):
...
@@ -2214,8 +2214,8 @@ class AudioSessionListView(QListView):
def
keyPressEvent
(
self
,
event
):
def
keyPressEvent
(
self
,
event
):
char
=
event
.
text
()
.
upper
()
char
=
event
.
text
()
.
upper
()
if
char
and
char
in
string
.
digits
+
string
.
uppercase
+
'#*'
:
if
char
and
char
in
string
.
digits
+
string
.
uppercase
+
'#*'
:
letter_map
=
{
'2'
:
'ABC'
,
'3'
:
'DEF'
,
'4'
:
'GHI'
,
'5'
:
'JKL'
,
'6'
:
'MNO'
,
'7'
:
'PQRS'
,
'8'
:
'TUV'
,
'9'
:
'WXYZ'
}
digit_map
=
{
'2'
:
'ABC'
,
'3'
:
'DEF'
,
'4'
:
'GHI'
,
'5'
:
'JKL'
,
'6'
:
'MNO'
,
'7'
:
'PQRS'
,
'8'
:
'TUV'
,
'9'
:
'WXYZ'
}
letter_map
=
dict
(
chain
(
*
(
izip
(
letters
,
repeat
(
char
))
for
char
,
letters
in
letter_map
.
iteritems
())))
letter_map
=
{
letter
:
digit
for
digit
,
letter_group
in
digit_map
.
iteritems
()
for
letter
in
letter_group
}
for
session
in
(
s
for
s
in
self
.
model
()
.
sessions
if
s
.
active
):
for
session
in
(
s
for
s
in
self
.
model
()
.
sessions
if
s
.
active
):
session
.
send_dtmf
(
letter_map
.
get
(
char
,
char
))
session
.
send_dtmf
(
letter_map
.
get
(
char
,
char
))
elif
event
.
key
()
in
(
Qt
.
Key_Up
,
Qt
.
Key_Down
):
elif
event
.
key
()
in
(
Qt
.
Key_Up
,
Qt
.
Key_Down
):
...
...
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