1
2
3
4
5
6
7
8 """gp -- a platform-independent interface to a gnuplot process.
9
10 This file imports a low-level, platform-independent interface to the
11 gnuplot program. Which interface is imported depends on the platform.
12 There are variations of this file for Unix, the Macintosh, and for
13 Windows called gp_unix.py, gp_mac.py, and gp_win32.py, respectively.
14 Note that the end-user should use the more capable interface from
15 __init__.py (i.e., 'import Gnuplot') rather than the low-level
16 interface imported by this file.
17
18 See gp_unix.py for most documentation about the facilities of the
19 gp_*.py modules.
20
21 """
22
23 import sys, string
24
25
26
27
28 if sys.platform == 'mac':
29 from gp_mac import GnuplotOpts, GnuplotProcess, test_persist
30 elif sys.platform == 'win32':
31 from gp_win32 import GnuplotOpts, GnuplotProcess, test_persist
32 elif sys.platform == 'darwin':
33 from gp_macosx import GnuplotOpts, GnuplotProcess, test_persist
34 elif sys.platform[:4] == 'java':
35 from gp_java import GnuplotOpts, GnuplotProcess, test_persist
36 elif sys.platform == 'cygwin':
37 from gp_cygwin import GnuplotOpts, GnuplotProcess, test_persist
38 else:
39 from gp_unix import GnuplotOpts, GnuplotProcess, test_persist
40
41
43 """Return string s quoted and surrounded by double-quotes for gnuplot."""
44
45 for c in ['\\', '\"']:
46 s = string.replace(s, c, '\\' + c)
47
48 return '"%s"' % (s,)
49