gp.py :  » Chart-Report » Gnuplot.py » gnuplot-py-1.8 » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Chart Report » Gnuplot.py 
Gnuplot.py » gnuplot py 1.8 » gp.py
# $Id: gp.py 292 2006-03-03 09:49:04Z mhagger $

# Copyright (C) 1998-2003 Michael Haggerty <mhagger@alum.mit.edu>
#
# This file is licensed under the GNU Lesser General Public License
# (LGPL).  See LICENSE.txt for details.

"""gp -- a platform-independent interface to a gnuplot process.

This file imports a low-level, platform-independent interface to the
gnuplot program.  Which interface is imported depends on the platform.
There are variations of this file for Unix, the Macintosh, and for
Windows called gp_unix.py, gp_mac.py, and gp_win32.py, respectively.
Note that the end-user should use the more capable interface from
__init__.py (i.e., 'import Gnuplot') rather than the low-level
interface imported by this file.

See gp_unix.py for most documentation about the facilities of the
gp_*.py modules.

"""

import sys, string

# Low-level communication with gnuplot is platform-dependent.  Import
# the appropriate implementation of GnuplotProcess based on the
# platform:
if sys.platform == 'mac':
    from gp_mac import GnuplotOpts,GnuplotProcess,test_persist
elif sys.platform == 'win32':
    from gp_win32 import GnuplotOpts,GnuplotProcess,test_persist
elif sys.platform == 'darwin':
    from gp_macosx import GnuplotOpts,GnuplotProcess,test_persist
elif sys.platform[:4] == 'java':
    from gp_java import GnuplotOpts,GnuplotProcess,test_persist
elif sys.platform == 'cygwin':
    from gp_cygwin import GnuplotOpts,GnuplotProcess,test_persist
else:
    from gp_unix import GnuplotOpts,GnuplotProcess,test_persist


def double_quote_string(s):
    """Return string s quoted and surrounded by double-quotes for gnuplot."""

    for c in ['\\', '\"']:
        s = string.replace(s, c, '\\' + c)

    return '"%s"' % (s,)


www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.