Back to index

unity  6.0.0
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
unity.emulators.dash.Dash Class Reference
Inheritance diagram for unity.emulators.dash.Dash:
Inheritance graph
[legend]
Collaboration diagram for unity.emulators.dash.Dash:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def view
def toggle_reveal
def ensure_visible
def ensure_hidden
def visible
def monitor
def search_string
def searchbar
def get_num_rows
def clear_search
def reveal_application_lens
def reveal_music_lens
def reveal_file_lens
def reveal_command_lens
def active_lens
def get_current_lens

Public Attributes

 controller

Private Member Functions

def _reveal_lens

Private Attributes

 _keyboard

Detailed Description

An emulator class that makes it easier to interact with the unity dash.

Definition at line 23 of file dash.py.


Constructor & Destructor Documentation

An emulator class that makes it easier to interact with the unity dash.

Definition at line 28 of file dash.py.

00028 
00029     def __init__(self):
00030         super(Dash, self).__init__()
00031         controllers = DashController.get_all_instances()
00032         assert(len(controllers) == 1)
00033         self.controller = controllers[0]
00034         self._keyboard = Keyboard()


Member Function Documentation

def unity.emulators.dash.Dash._reveal_lens (   self,
  binding_name,
  clear_search 
) [private]

Definition at line 123 of file dash.py.

00123 
00124     def _reveal_lens(self, binding_name, clear_search):
00125         self.keybinding_hold(binding_name)
00126         self.keybinding_tap(binding_name)
00127         self.keybinding_release(binding_name)
00128         self.visible.wait_for(True)
00129         if clear_search:
00130             self.clear_search()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 132 of file dash.py.

00132 
00133     def active_lens(self):
00134         return self.view.get_lensbar().active_lens

Clear the contents of the search bar.

Assumes dash is already visible, and search bar has keyboard focus.

Definition at line 89 of file dash.py.

00089 
00090     def clear_search(self):
00091         """Clear the contents of the search bar.
00092 
00093         Assumes dash is already visible, and search bar has keyboard focus.
00094 
00095         """
00096         self._keyboard.press_and_release("Ctrl+a")
00097         self._keyboard.press_and_release("Delete")
00098         self.search_string.wait_for("")

Here is the caller graph for this function:

Ensures the dash is hidden.

Definition at line 58 of file dash.py.

00058 
00059     def ensure_hidden(self):
00060         """
00061         Ensures the dash is hidden.
00062         """
00063         if self.visible:
00064             self.toggle_reveal()
00065             self.visible.wait_for(False)

Here is the call graph for this function:

def unity.emulators.dash.Dash.ensure_visible (   self,
  clear_search = True 
)
Ensures the dash is visible.

Definition at line 48 of file dash.py.

00048 
00049     def ensure_visible(self, clear_search=True):
00050         """
00051         Ensures the dash is visible.
00052         """
00053         if not self.visible:
00054             self.toggle_reveal()
00055             self.visible.wait_for(True)
00056             if clear_search:
00057                 self.clear_search()

Here is the call graph for this function:

Get the currently-active LensView object.

Definition at line 135 of file dash.py.

00135 
00136     def get_current_lens(self):
00137         """Get the currently-active LensView object."""
00138         active_lens_name = self.view.get_lensbar().active_lens
00139         return self.view.get_lensview_by_name(active_lens_name)
00140 

Returns the number of displayed rows in the dash.

Definition at line 85 of file dash.py.

00085 
00086     def get_num_rows(self):
00087         """Returns the number of displayed rows in the dash."""
00088         return self.view.num_rows

The monitor where the dash is

Definition at line 72 of file dash.py.

00072 
00073     def monitor(self):
00074         """The monitor where the dash is"""
00075         return self.controller.monitor

Here is the caller graph for this function:

def unity.emulators.dash.Dash.reveal_application_lens (   self,
  clear_search = True 
)
Reveal the application lense.

Definition at line 99 of file dash.py.

00099 
00100     def reveal_application_lens(self, clear_search=True):
00101         """Reveal the application lense."""
00102         logger.debug("Revealing application lens with Super+a.")
00103         self._reveal_lens("lens_reveal/apps", clear_search)
00104         return self.view.get_lensview_by_name("applications.lens")

Here is the call graph for this function:

def unity.emulators.dash.Dash.reveal_command_lens (   self,
  clear_search = True 
)
Reveal the 'run command' lens.

Definition at line 117 of file dash.py.

00117 
00118     def reveal_command_lens(self, clear_search=True):
00119         """Reveal the 'run command' lens."""
00120         logger.debug("Revealing command lens with Alt+F2.")
00121         self._reveal_lens("lens_reveal/command", clear_search)
00122         return self.view.get_lensview_by_name("commands.lens")

Here is the call graph for this function:

def unity.emulators.dash.Dash.reveal_file_lens (   self,
  clear_search = True 
)
Reveal the file lense.

Definition at line 111 of file dash.py.

00111 
00112     def reveal_file_lens(self, clear_search=True):
00113         """Reveal the file lense."""
00114         logger.debug("Revealing file lens with Super+f.")
00115         self._reveal_lens("lens_reveal/files", clear_search)
00116         return self.view.get_lensview_by_name("files.lens")

Here is the call graph for this function:

def unity.emulators.dash.Dash.reveal_music_lens (   self,
  clear_search = True 
)
Reveal the music lense.

Definition at line 105 of file dash.py.

00105 
00106     def reveal_music_lens(self, clear_search=True):
00107         """Reveal the music lense."""
00108         logger.debug("Revealing music lens with Super+m.")
00109         self._reveal_lens("lens_reveal/music", clear_search)
00110         return self.view.get_lensview_by_name("music.lens")

Here is the call graph for this function:

Definition at line 77 of file dash.py.

00077 
00078     def search_string(self):
00079         return self.searchbar.search_string

Returns the searchbar attached to the dash.

Definition at line 81 of file dash.py.

00081 
00082     def searchbar(self):
00083         """Returns the searchbar attached to the dash."""
00084         return self.view.get_searchbar()

Reveals the dash if it's currently hidden, hides it otherwise.

Definition at line 39 of file dash.py.

00039 
00040     def toggle_reveal(self):
00041         """
00042         Reveals the dash if it's currently hidden, hides it otherwise.
00043         """
00044         old_state = self.visible
00045         logger.debug("Toggling dash visibility with Super key.")
00046         self.keybinding("dash/reveal", 0.1)
00047         self.visible.wait_for(not old_state)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 36 of file dash.py.

00036 
00037     def view(self):
00038         return self.controller.get_dash_view()

Here is the caller graph for this function:

Returns if the dash is currently visible

Definition at line 67 of file dash.py.

00067 
00068     def visible(self):
00069         """Returns if the dash is currently visible"""
00070         return self.controller.visible

Here is the caller graph for this function:


Member Data Documentation

Definition at line 33 of file dash.py.

Definition at line 32 of file dash.py.


The documentation for this class was generated from the following file: