summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/ext/shell_escape.py4
-rw-r--r--ranger/fsobject/fsobject.py4
-rw-r--r--ranger/gui/widgets/console.py8
-rw-r--r--ranger/runner.py1
4 files changed, 8 insertions, 9 deletions
diff --git a/ranger/ext/shell_escape.py b/ranger/ext/shell_escape.py
index 682cd86f..01304033 100644
--- a/ranger/ext/shell_escape.py
+++ b/ranger/ext/shell_escape.py
@@ -20,12 +20,12 @@ META_CHARS = (' ', "'", '"', '`', '&', '|', ';',
 		'$', '!', '(', ')', '[', ']', '<', '>')
 META_DICT = dict([(mc, '\\' + mc) for mc in META_CHARS])
 
-def shell_escape(string):
+def shell_quote(string):
 	"""Escapes by quoting"""
 	return "'" + str(string).replace("'", "'\\''") + "'"
 
 
-def shell_escape2(arg):
+def shell_escape(arg):
 	"""Escapes by adding backslashes"""
 	arg = str(arg)
 	arg = arg.replace('\\', '\\\\') # make sure this comes at the start
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index 4b734e8a..76e9bd3c 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -18,7 +18,7 @@ DOCUMENT_BASENAMES = 'README TODO LICENSE COPYING INSTALL'.split()
 
 from . import T_FILE, T_DIRECTORY, T_UNKNOWN, T_NONEXISTANT, BAD_INFO
 from ranger.shared import MimeTypeAware, FileManagerAware
-from ranger.ext.shell_escape import shell_escape2
+from ranger.ext.shell_escape import shell_escape
 
 class FileSystemObject(MimeTypeAware, FileManagerAware):
 	is_file = False
@@ -82,7 +82,7 @@ class FileSystemObject(MimeTypeAware, FileManagerAware):
 	@property
 	def shell_escaped_basename(self):
 		if self._shell_escaped_basename is None:
-			self._shell_escaped_basename = shell_escape2(self.basename)
+			self._shell_escaped_basename = shell_escape(self.basename)
 		return self._shell_escaped_basename
 
 	def get_description(self):
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 34c8abf5..a5fd30a2 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -25,7 +25,7 @@ from . import Widget
 from ranger import commands
 from ranger.gui.widgets.console_mode import is_valid_mode, mode_to_class
 from ranger import log
-from ranger.ext.shell_escape import shell_escape
+from ranger.ext.shell_escape import shell_quote
 
 DEFAULT_HISTORY = 0
 SEARCH_HISTORY = 1
@@ -421,11 +421,11 @@ class OpenConsole(ConsoleWithTab):
 		dct = {}
 
 		if self.fm.env.cf:
-			dct['f'] = shell_escape(self.fm.env.cf.basename)
+			dct['f'] = shell_quote(self.fm.env.cf.basename)
 		else:
 			dct['f'] = ''
 
-		dct['s'] = ' '.join(shell_escape(fl.basename) \
+		dct['s'] = ' '.join(shell_quote(fl.basename) \
 				for fl in self.fm.env.get_selection())
 
 		return _CustomTemplate(command).safe_substitute(dct)
@@ -445,7 +445,7 @@ class OpenConsole(ConsoleWithTab):
 			add_selection = True
 
 		if add_selection:
-			cmd += ' ' + ' '.join(shell_escape(fl.basename) \
+			cmd += ' ' + ' '.join(shell_quote(fl.basename) \
 					for fl in self.env.get_selection())
 
 		return (cmd, flags)
diff --git a/ranger/runner.py b/ranger/runner.py
index c61c11a5..25c0fb3b 100644
--- a/ranger/runner.py
+++ b/ranger/runner.py
@@ -33,7 +33,6 @@ p: redirect output to the pager
 import os
 import sys
 from subprocess import Popen, PIPE
-from ranger.ext.shell_escape import shell_escape
 from ranger.ext.waitpid_no_intr import waitpid_no_intr
 
 
='#n289'>289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 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