|
5 | 5 | import re |
6 | 6 | from itertools import izip |
7 | 7 | import csv |
| 8 | +from warnings import warn |
8 | 9 |
|
9 | 10 | import numpy as np |
10 | 11 |
|
@@ -427,35 +428,6 @@ def read_fwf(filepath_or_buffer, colspecs=None, widths=None, **kwds): |
427 | 428 | return _read(filepath_or_buffer, kwds) |
428 | 429 |
|
429 | 430 |
|
430 | | -def read_clipboard(**kwargs): # pragma: no cover |
431 | | - """ |
432 | | - Read text from clipboard and pass to read_table. See read_table for the |
433 | | - full argument list |
434 | | -
|
435 | | - Returns |
436 | | - ------- |
437 | | - parsed : DataFrame |
438 | | - """ |
439 | | - from pandas.util.clipboard import clipboard_get |
440 | | - text = clipboard_get() |
441 | | - return read_table(StringIO(text), **kwargs) |
442 | | - |
443 | | - |
444 | | -def to_clipboard(obj): # pragma: no cover |
445 | | - """ |
446 | | - Attempt to write text representation of object to the system clipboard |
447 | | -
|
448 | | - Notes |
449 | | - ----- |
450 | | - Requirements for your platform |
451 | | - - Linux: xsel command line tool |
452 | | - - Windows: Python win32 extensions |
453 | | - - OS X: |
454 | | - """ |
455 | | - from pandas.util.clipboard import clipboard_set |
456 | | - clipboard_set(str(obj)) |
457 | | - |
458 | | - |
459 | 431 | # common NA values |
460 | 432 | # no longer excluding inf representations |
461 | 433 | # '1.#INF','-1.#INF', '1.#INF000000', |
@@ -1940,15 +1912,25 @@ def _make_reader(self, f): |
1940 | 1912 | self.data = FixedWidthReader(f, self.colspecs, self.delimiter) |
1941 | 1913 |
|
1942 | 1914 |
|
| 1915 | +##### deprecations in 0.11.1 ##### |
| 1916 | +##### remove in 0.12 ##### |
| 1917 | + |
| 1918 | +from pandas.io import clipboard |
| 1919 | +def read_clipboard(**kwargs): |
| 1920 | + warn("read_clipboard is now a top-level accessible via pandas.read_clipboard", FutureWarning) |
| 1921 | + clipboard.read_clipboard(**kwargs) |
| 1922 | + |
| 1923 | +def to_clipboard(obj): |
| 1924 | + warn("to_clipboard is now an object level method accessible via obj.to_clipboard()", FutureWarning) |
| 1925 | + clipboard.to_clipboard(obj) |
| 1926 | + |
1943 | 1927 | from pandas.io import excel |
1944 | 1928 | class ExcelWriter(excel.ExcelWriter): |
1945 | 1929 | def __init__(self, path): |
1946 | | - from warnings import warn |
1947 | 1930 | warn("ExcelWriter can now be imported from: pandas.io.excel", FutureWarning) |
1948 | 1931 | super(ExcelWriter, self).__init__(path) |
1949 | 1932 |
|
1950 | 1933 | class ExcelFile(excel.ExcelFile): |
1951 | 1934 | def __init__(self, path_or_buf, kind=None, **kwds): |
1952 | | - from warnings import warn |
1953 | 1935 | warn("ExcelFile can now be imported from: pandas.io.excel", FutureWarning) |
1954 | 1936 | super(ExcelFile, self).__init__(path_or_buf, kind=kind, **kwds) |
0 commit comments