summary refs log tree commit diff stats
path: root/ranger.py
blob: aca1b557029c63347cef4d51a6a5a63ce9768f2c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/python -O
# coding=utf-8
#
# Ranger: Explore your forest of files from inside your terminal
# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# ----------------------------------------------------------------------------
#
# An embedded shell script. It allows you to change the directory
# after you exit ranger by starting it with: source ranger ranger
"""":
if [ $1 ]; then
	$@ --fail-if-run && cd "$(grep \^\' ~/.ranger/bookmarks | cut -b3-)"
else
	echo "usage: source path/to/ranger.py path/to/ranger.py"
fi
return 1
"""

# Redefine the docstring, since the previous one was hijacked to
# embed a shellscript.
__doc__ = """Ranger - file browser for the unix terminal"""

# Importing the main method may fail if the ranger directory
# is neither in the same directory as this file, nor in one of
# pythons global import paths.
try:
	from ranger.__main__ import main
except ImportError:
	import sys
	if '-d' not in sys.argv and '--debug' not in sys.argv:
		print("Can't import the main module.")
		print("To run an uninstalled copy of ranger,")
		print("launch ranger.py in the top directory.")
	else:
		raise
else:
	main()
Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef MOCK_ACCOUNTS_H
#define MOCK_ACCOUNTS_H

void mock_accounts_get_account(void);
void accounts_get_account_expect_and_return(const char * const name, ProfAccount *account);
void accounts_get_account_return(ProfAccount *account);

void mock_accounts_get_list(void);
void accounts_get_list_return(gchar **accounts);

void mock_accounts_add(void);
void stub_accounts_add(void);
void accounts_add_expect_account_name(char *account_name);

void mock_accounts_enable(void);
void accounts_enable_expect(char *name);
void accounts_enable_return(gboolean result);

void mock_accounts_disable(void);
void accounts_disable_expect(char *name);
void accounts_disable_return(gboolean result);

void mock_accounts_rename(void);
void accounts_rename_expect(char *account_name, char *new_name);
void accounts_rename_return(gboolean result);

void mock_accounts_account_exists(void);
void accounts_account_exists_expect(char *account_name);
void accounts_account_exists_return(gboolean result);

void mock_accounts_set_jid(void);
void stub_accounts_set_jid(void);
void accounts_set_jid_expect(char *account_name, char *jid);

void mock_accounts_set_resource(void);
void stub_accounts_set_resource(void);
void accounts_set_resource_expect(char *account_name, char *resource);

void mock_accounts_set_server(void);
void stub_accounts_set_server(void);
void accounts_set_server_expect(char *account_name, char *server);

void mock_accounts_set_password(void);
void stub_accounts_set_password(void);
void accounts_set_password_expect(char *account_name, char *password);

void mock_accounts_set_muc_service(void);
void stub_accounts_set_muc_service(void);
void accounts_set_muc_service_expect(char *account_name, char *service);

void mock_accounts_set_muc_nick(void);
void stub_accounts_set_muc_nick(void);
void accounts_set_muc_nick_expect(char *account_name, char *nick);

void mock_accounts_set_priorities(void);
void stub_accounts_set_priorities(void);
void accounts_set_priority_online_expect(char *account_name, gint priority);
void accounts_set_priority_chat_expect(char *account_name, gint priority);
void accounts_set_priority_away_expect(char *account_name, gint priority);
void accounts_set_priority_xa_expect(char *account_name, gint priority);
void accounts_set_priority_dnd_expect(char *account_name, gint priority);

void mock_accounts_set_login_presence(void);
void stub_accounts_set_login_presence(void);
void accounts_set_login_presence_expect(char *account_name, char *presence);

void mock_accounts_get_last_presence(void);
void accounts_get_last_presence_return(resource_presence_t presence);

#endif