summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-19 10:36:50 -0400
committerGitHub <noreply@github.com>2018-09-19 10:36:50 -0400
commitb1a6dd3bdb27590aec4612ba4bd58eb416a60d07 (patch)
tree7d41c99476227dff3c06c525671c8ecbf84dc4f1
parent36d9ec82c50b037becc204f9fc05d94c4d391ccf (diff)
parent9f3aa8955b9cb20ec48990227315276a34e7da32 (diff)
downloadcmd2-git-b1a6dd3bdb27590aec4612ba4bd58eb416a60d07.tar.gz
Merge pull request #517 from python-cmd2/fix_minor_warnings
Fix a couple minor lint warnings
-rw-r--r--cmd2/cmd2.py2
-rw-r--r--cmd2/transcript.py2
-rwxr-xr-xexamples/alias_startup.py4
-rw-r--r--examples/transcripts/exampleSession.txt2
-rw-r--r--examples/transcripts/transcript_regex.txt2
5 files changed, 8 insertions, 4 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 888d9531..68e0aef2 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -3031,7 +3031,7 @@ a..b, a:b, a:, ..b items by indices (inclusive)
# get the output out of the buffer
output = membuf.read()
# and add the regex-escaped output to the transcript
- transcript += output.replace('/', '\/')
+ transcript += output.replace('/', r'\/')
# Restore stdout to its original state
self.stdout = saved_self_stdout
diff --git a/cmd2/transcript.py b/cmd2/transcript.py
index 5ba8d20d..8df58634 100644
--- a/cmd2/transcript.py
+++ b/cmd2/transcript.py
@@ -106,7 +106,7 @@ class Cmd2TestCase(unittest.TestCase):
self.assertTrue(re.match(expected, result, re.MULTILINE | re.DOTALL), message)
def _transform_transcript_expected(self, s: str) -> str:
- """Parse the string with slashed regexes into a valid regex.
+ r"""Parse the string with slashed regexes into a valid regex.
Given a string like:
diff --git a/examples/alias_startup.py b/examples/alias_startup.py
index 4ae91661..8a289e79 100755
--- a/examples/alias_startup.py
+++ b/examples/alias_startup.py
@@ -14,6 +14,10 @@ class AliasAndStartup(cmd2.Cmd):
alias_script = os.path.join(os.path.dirname(__file__), '.cmd2rc')
super().__init__(startup_script=alias_script)
+ def do_nothing(self, args):
+ """This command does nothing and produces no output."""
+ pass
+
if __name__ == '__main__':
app = AliasAndStartup()
diff --git a/examples/transcripts/exampleSession.txt b/examples/transcripts/exampleSession.txt
index 1d1b3b79..6318776f 100644
--- a/examples/transcripts/exampleSession.txt
+++ b/examples/transcripts/exampleSession.txt
@@ -9,7 +9,7 @@ debug: False
echo: False
editor: /.*?/
feedback_to_output: False
-locals_in_py: True
+locals_in_py: False
maxrepeats: 3
prompt: (Cmd)/ /
quiet: False
diff --git a/examples/transcripts/transcript_regex.txt b/examples/transcripts/transcript_regex.txt
index adf4d77e..08588ab1 100644
--- a/examples/transcripts/transcript_regex.txt
+++ b/examples/transcripts/transcript_regex.txt
@@ -9,7 +9,7 @@ debug: False
echo: False
editor: /.*?/
feedback_to_output: False
-locals_in_py: True
+locals_in_py: False
maxrepeats: 3
prompt: (Cmd)/ /
quiet: False