Skip to content

Commit e67b4e6

Browse files
committed
Suppress output of demo comments w/ leading '##'.
Addresses: #719 (comment)
1 parent d668044 commit e67b4e6

4 files changed

Lines changed: 31 additions & 16 deletions

File tree

gcloud/datastore/demo/demo.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# Copyright 2014 Google Inc. All rights reserved.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
1+
## Copyright 2014 Google Inc. All rights reserved.
2+
##
3+
## Licensed under the Apache License, Version 2.0 (the "License");
4+
## you may not use this file except in compliance with the License.
5+
## You may obtain a copy of the License at
6+
##
7+
## http://www.apache.org/licenses/LICENSE-2.0
8+
##
9+
## Unless required by applicable law or agreed to in writing, software
10+
## distributed under the License is distributed on an "AS IS" BASIS,
11+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
## See the License for the specific language governing permissions and
13+
## limitations under the License.
1414
# Welcome to the gCloud Datastore Demo! (hit enter)
1515
# We're going to walk through some of the basics...
1616
# Don't worry though. You don't need to do anything, just keep hitting enter...

gcloud/demo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class DemoRunner(object):
2626

2727
KEYPRESS_DELAY = 0.02
2828
GLOBALS, LOCALS = globals(), locals()
29-
CODE, COMMENT = 'code', 'comment'
29+
CODE, COMMENT, COPYRIGHT = 'code', 'comment', 'copright'
3030

3131
def __init__(self, fp):
3232
self.lines = [line.rstrip() for line in fp.readlines()]
@@ -55,10 +55,11 @@ def wait(self):
5555

5656
@classmethod
5757
def get_line_type(cls, line):
58+
if line.startswith('##'):
59+
return cls.COPYRIGHT
5860
if line.startswith('#'):
5961
return cls.COMMENT
60-
else:
61-
return cls.CODE
62+
return cls.CODE
6263

6364
def get_indent_level(self, line):
6465
if not line.strip():

gcloud/storage/demo/demo.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## Copyright 2014 Google Inc. All rights reserved.
2+
##
3+
## Licensed under the Apache License, Version 2.0 (the "License");
4+
## you may not use this file except in compliance with the License.
5+
## You may obtain a copy of the License at
6+
##
7+
## http://www.apache.org/licenses/LICENSE-2.0
8+
##
9+
## Unless required by applicable law or agreed to in writing, software
10+
## distributed under the License is distributed on an "AS IS" BASIS,
11+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
## See the License for the specific language governing permissions and
13+
## limitations under the License.
114
# Welcome to the gCloud Storage Demo! (hit enter)
215

316
# We're going to walk through some of the basics...,

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ deps =
4343
Sphinx
4444

4545
[pep8]
46+
ignore = E123,E266
4647
exclude = gcloud/datastore/_datastore_v1_pb2.py,docs/conf.py,*.egg/,.*/,_gcloud_vendor/
4748
verbose = 1
4849

0 commit comments

Comments
 (0)