Skip to content

Commit bd60cd1

Browse files
authored
Merge pull request #1255 from p-l-/fix-progs-pdfps
Use xdg-open (Linux / *BSD) or open (MacOS) to open PDF & PS files by default
2 parents f05c8ba + 04584ea commit bd60cd1

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

scapy/config.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
from __future__ import print_function
1212
import os,time,socket,sys
1313

14-
from scapy import VERSION
15-
from scapy.data import *
16-
from scapy import base_classes
17-
from scapy.themes import NoTheme, apply_ipython_style
14+
from scapy import VERSION, base_classes
15+
from scapy.consts import DARWIN
16+
from scapy.data import ETHER_TYPES, IP_PROTOS, TCP_SERVICES, UDP_SERVICES, \
17+
MANUFDB
1818
from scapy.error import log_scapy
19-
import scapy.modules.six as six
19+
from scapy.modules import six
20+
from scapy.themes import NoTheme, apply_ipython_style
2021

2122
############
2223
## Config ##
@@ -60,8 +61,8 @@ def __set__(self, obj, val):
6061

6162

6263
class ProgPath(ConfClass):
63-
pdfreader = "acroread"
64-
psreader = "gv"
64+
pdfreader = "open" if DARWIN else "xdg-open"
65+
psreader = "open" if DARWIN else "xdg-open"
6566
dot = "dot"
6667
display = "display"
6768
tcpdump = "tcpdump"
@@ -236,7 +237,7 @@ def keys(self):
236237
return [k for k in six.iterkeys(self.__dict__) if t0-self._timetable[k] < self.timeout]
237238
def values(self):
238239
if self.timeout is None:
239-
return six.values(self)
240+
return list(six.itervalues(self))
240241
t0=time.time()
241242
return [v for (k,v) in six.iteritems(self.__dict__) if t0-self._timetable[k] < self.timeout]
242243
def __len__(self):

0 commit comments

Comments
 (0)