From a469d335ff5d3600009a72b9fb0778a4ec2121bb Mon Sep 17 00:00:00 2001 From: Andy Hayden Date: Tue, 11 Jun 2013 15:36:52 +0100 Subject: [PATCH] DOC updated to reflect using pyperclip for clipboard --- LICENSES/OTHER | 30 ++++++++++++++++++++++++++++++ RELEASE.rst | 2 ++ pandas/core/generic.py | 10 ++++++++++ pandas/io/clipboard.py | 4 ++-- 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/LICENSES/OTHER b/LICENSES/OTHER index a1b367fe6061c..f0550b4ee208a 100644 --- a/LICENSES/OTHER +++ b/LICENSES/OTHER @@ -48,3 +48,33 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +Pyperclip v1.3 license +---------------------- + +Copyright (c) 2010, Albert Sweigart +All rights reserved. + +BSD-style license: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the pyperclip nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY Albert Sweigart "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL Albert Sweigart BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/RELEASE.rst b/RELEASE.rst index 307986ab81681..a03451542796a 100644 --- a/RELEASE.rst +++ b/RELEASE.rst @@ -73,6 +73,8 @@ pandas 0.11.1 - ``melt`` now accepts the optional parameters ``var_name`` and ``value_name`` to specify custom column names of the returned DataFrame (GH3649_), thanks @hoechenberger + - clipboard functions use pyperclip (no dependencies on Windows, alternative + dependencies offered for Linux) (GH3837_). - Plotting functions now raise a ``TypeError`` before trying to plot anything if the associated objects have have a dtype of ``object`` (GH1818_, GH3572_). This happens before any drawing takes place which elimnates any diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 5533584745167..1ea9c48f45269 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -492,6 +492,16 @@ def to_hdf(self, path_or_buf, key, **kwargs): return pytables.to_hdf(path_or_buf, key, self, **kwargs) def to_clipboard(self): + """ + Attempt to write text representation of object to the system clipboard + + Notes + ----- + Requirements for your platform + - Linux: xclip, or xsel (with gtk or PyQt4 modules) + - Windows: + - OS X: + """ from pandas.io import clipboard clipboard.to_clipboard(self) diff --git a/pandas/io/clipboard.py b/pandas/io/clipboard.py index c763c1e8faadb..4e3f7203a279e 100644 --- a/pandas/io/clipboard.py +++ b/pandas/io/clipboard.py @@ -23,8 +23,8 @@ def to_clipboard(obj): # pragma: no cover Notes ----- Requirements for your platform - - Linux: xsel command line tool - - Windows: Python win32 extensions + - Linux: xclip, or xsel (with gtk or PyQt4 modules) + - Windows: - OS X: """ from pandas.util.clipboard import clipboard_set