summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-04-13 13:50:04 +0200
committerhut <hut@lepus.uberspace.de>2015-04-14 00:14:54 +0200
commit5791c07955761aa2b963510a02de4a65df285fb8 (patch)
treef05fd5aee8ed104507d3023282d7c7233da82c21 /ranger
parent116d214e261b9e76a49411d65045f1a73efb1799 (diff)
downloadranger-5791c07955761aa2b963510a02de4a65df285fb8.tar.gz
core.environment: deleted module, it was obsolete
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py5
-rw-r--r--ranger/core/environment.py111
-rw-r--r--ranger/core/shared.py7
-rw-r--r--ranger/gui/displayable.py4
4 files changed, 4 insertions, 123 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 92b8a097..58f7aa20 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -21,8 +21,7 @@ from ranger.ext.keybinding_parser import key_to_string, construct_keybinding
 from ranger.ext.shell_escape import shell_quote
 from ranger.ext.next_available_filename import next_available_filename
 from ranger.ext.rifle import squash_flags, ASK_COMMAND
-from ranger.core.shared import FileManagerAware, EnvironmentAware, \
-        SettingsAware
+from ranger.core.shared import FileManagerAware, SettingsAware
 from ranger.core.tab import Tab
 from ranger.container.file import File
 from ranger.core.loader import CommandLoader, CopyLoader
@@ -36,7 +35,7 @@ class _MacroTemplate(string.Template):
     delimiter = ranger.MACRO_DELIMITER
     idpattern = r"[_a-z0-9]*"
 
-class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
+class Actions(FileManagerAware, SettingsAware):
     # --------------------------
     # -- Basic Commands
     # --------------------------
diff --git a/ranger/core/environment.py b/ranger/core/environment.py
deleted file mode 100644
index fddb8f9f..00000000
--- a/ranger/core/environment.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# This file is part of ranger, the console file manager.
-# License: GNU GPL version 3, see the file "AUTHORS" for details.
-
-# THIS WHOLE FILE IS OBSOLETE AND EXISTS FOR BACKWARDS COMPATIBILITIY
-
-import os
-from ranger.ext.signals import SignalDispatcher
-from ranger.core.shared import SettingsAware, FileManagerAware
-
-# COMPAT
-class Environment(SettingsAware, FileManagerAware, SignalDispatcher):
-    def __init__(self, path):
-        SignalDispatcher.__init__(self)
-
-    def _get_copy(self): return self.fm.copy_buffer
-    def _set_copy(self, obj): self.fm.copy_buffer = obj
-    copy = property(_get_copy, _set_copy)
-
-    def _get_cut(self): return self.fm.do_cut
-    def _set_cut(self, obj): self.fm.do_cut = obj
-    cut = property(_get_cut, _set_cut)
-
-    def _get_keymaps(self): return self.fm.ui.keymaps
-    def _set_keymaps(self, obj): self.fm.ui.keymaps = obj
-    keymaps = property(_get_keymaps, _set_keymaps)
-
-    def _get_keybuffer(self): return self.fm.ui.keybuffer
-    def _set_keybuffer(self, obj): self.fm.ui.keybuffer = obj
-    keybuffer = property(_get_keybuffer, _set_keybuffer)
-
-    def _get_username(self): return self.fm.username
-    def _set_username(self, obj): self.fm.username = obj
-    username = property(_get_username, _set_username)
-
-    def _get_hostname(self): return self.fm.hostname
-    def _set_hostname(self, obj): self.fm.hostname = obj
-    hostname = property(_get_hostname, _set_hostname)
-
-    def _get_home_path(self): return self.fm.home_path
-    def _set_home_path(self, obj): self.fm.home_path = obj
-    home_path = property(_get_home_path, _set_home_path)
-
-    def _get_get_directory(self): return self.fm.get_directory
-    def _set_get_directory(self, obj): self.fm.get_directory = obj
-    get_directory = property(_get_get_directory, _set_get_directory)
-
-    def _get_garbage_collect(self): return self.fm.garbage_collect
-    def _set_garbage_collect(self, obj): self.fm.garbage_collect = obj
-    garbage_collect = property(_get_garbage_collect, _set_garbage_collect)
-
-    def _get_cwd(self): return self.fm.thisdir
-    def _set_cwd(self, obj): self.fm.thisdir = obj
-    cwd = property(_get_cwd, _set_cwd)
-
-    def _get_cf(self): return self.fm.thisfile
-    def _set_cf(self, obj): self.fm.thisfile = obj
-    cf = property(_get_cf, _set_cf)
-
-    def _get_history(self): return self.fm.thistab.history
-    def _set_history(self, obj): self.fm.thistab.history = obj
-    history = property(_get_history, _set_history)
-
-    def _get_last_search(self): return self.fm.thistab.last_search
-    def _set_last_search(self, obj): self.fm.thistab.last_search = obj
-    last_search = property(_get_last_search, _set_last_search)
-
-    def _get_path(self): return self.fm.thistab.path
-    def _set_path(self, obj): self.fm.thistab.path = obj
-    path = property(_get_path, _set_path)
-
-    def _get_pathway(self): return self.fm.thistab.pathway
-    def _set_pathway(self, obj): self.fm.thistab.pathway = obj
-    pathway = property(_get_pathway, _set_pathway)
-
-    def _get_enter_dir(self): return self.fm.thistab.enter_dir
-    def _set_enter_dir(self, obj): self.fm.thistab.enter_dir = obj
-    enter_dir = property(_get_enter_dir, _set_enter_dir)
-
-    def _get_at_level(self): return self.fm.thistab.at_level
-    def _set_at_level(self, obj): self.fm.thistab.at_level = obj
-    at_level = property(_get_at_level, _set_at_level)
-
-    def _get_get_selection(self): return self.fm.thistab.get_selection
-    def _set_get_selection(self, obj): self.fm.thistab.get_selection = obj
-    get_selection = property(_get_get_selection, _set_get_selection)
-
-    def _get_assign_cursor_positions_for_subdirs(self):
-        return self.fm.thistab.assign_cursor_positions_for_subdirs
-    def _set_assign_cursor_positions_for_subdirs(self, obj):
-        self.fm.thistab.assign_cursor_positions_for_subdirs = obj
-    assign_cursor_positions_for_subdirs = property(
-            _get_assign_cursor_positions_for_subdirs,
-            _set_assign_cursor_positions_for_subdirs)
-
-    def _get_ensure_correct_pointer(self):
-        return self.fm.thistab.ensure_correct_pointer
-    def _set_ensure_correct_pointer(self, obj):
-        self.fm.thistab.ensure_correct_pointer = obj
-    ensure_correct_pointer = property(_get_ensure_correct_pointer,
-            _set_ensure_correct_pointer)
-
-    def _get_history_go(self): return self.fm.thistab.history_go
-    def _set_history_go(self, obj): self.fm.thistab.history_go = obj
-    history_go = property(_get_history_go, _set_history_go)
-
-    def _set_cf_from_signal(self, signal):
-        self.fm._cf = signal.new
-
-    def get_free_space(self, path):
-        stat = os.statvfs(path)
-        return stat.f_bavail * stat.f_frsize
diff --git a/ranger/core/shared.py b/ranger/core/shared.py
index ab76b511..177ba15d 100644
--- a/ranger/core/shared.py
+++ b/ranger/core/shared.py
@@ -16,10 +16,3 @@ class SettingsAware(object):
     @staticmethod
     def _setup(settings):
         SettingsAware.settings = settings
-
-class EnvironmentAware(object):  # COMPAT
-    """DO NOT USE.  This is for backward compatibility only."""
-    @lazy_property
-    def env(self):
-        from ranger.core.environment import Environment
-        return Environment(".")
diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py
index 7e4290ee..d3adfe50 100644
--- a/ranger/gui/displayable.py
+++ b/ranger/gui/displayable.py
@@ -1,10 +1,10 @@
 # This file is part of ranger, the console file manager.
 # License: GNU GPL version 3, see the file "AUTHORS" for details.
 
-from ranger.core.shared import FileManagerAware, EnvironmentAware
+from ranger.core.shared import FileManagerAware
 from ranger.gui.curses_shortcuts import CursesShortcuts
 
-class Displayable(EnvironmentAware, FileManagerAware, CursesShortcuts):
+class Displayable(FileManagerAware, CursesShortcuts):
     """Displayables are objects which are displayed on the screen.
 
     This is just the abstract class, defining basic operations
n499'>499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853