Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress output of demo comments w/ leading '##'. #739

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions gcloud/datastore/demo/demo.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## Copyright 2014 Google Inc. All rights reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
# Welcome to the gCloud Datastore Demo! (hit enter)
# We're going to walk through some of the basics...
# Don't worry though. You don't need to do anything, just keep hitting enter...
Expand Down
7 changes: 4 additions & 3 deletions gcloud/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DemoRunner(object):

KEYPRESS_DELAY = 0.02
GLOBALS, LOCALS = globals(), locals()
CODE, COMMENT = 'code', 'comment'
CODE, COMMENT, COPYRIGHT = 'code', 'comment', 'copright'

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

@classmethod
def get_line_type(cls, line):
if line.startswith('##'):
return cls.COPYRIGHT
if line.startswith('#'):
return cls.COMMENT
else:
return cls.CODE
return cls.CODE

def get_indent_level(self, line):
if not line.strip():
Expand Down
13 changes: 13 additions & 0 deletions gcloud/storage/demo/demo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## Copyright 2014 Google Inc. All rights reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
# Welcome to the gCloud Storage Demo! (hit enter)

# We're going to walk through some of the basics...,
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ deps =
Sphinx

[pep8]
ignore = E123,E266

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

exclude = gcloud/datastore/_datastore_v1_pb2.py,docs/conf.py,*.egg/,.*/,_gcloud_vendor/
verbose = 1

Expand Down