scripts/release/error.py
author Daniel Bentley <dbentley@google.com>
Sun, 12 Apr 2009 09:06:45 +0000
changeset 2168 ef7222d4847f
parent 1981 8cfb054b73b2
permissions -rw-r--r--
Use offset_linkid instead of offset to scan >1000 entities. this is a first-cut. It works in all the ways I could make earlier versions fail. It passes link_id as URL parameters. It also has a new class LinkCreator which makes the main body of getListContents even easier to write. I wasn't sure if link_id's could have non alphanumeric characters; if so, they need to be URL encoded/decoded. I also need to go and remove any mention of raw offsets now, because we don't use them. I believe I've talked about this approach with a few of you and it sounded reasonable. Feel free to roll-back/fix/amend/comment-for-me-to-fix. This is my first big-logic-change to Melange. Patch by: Dan Bentley
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1822
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     1
# Copyright 2009 the Melange authors.
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     2
#
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     3
# Licensed under the Apache License, Version 2.0 (the "License");
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     4
# you may not use this file except in compliance with the License.
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     5
# You may obtain a copy of the License at
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     6
#
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     7
#   http://www.apache.org/licenses/LICENSE-2.0
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     8
#
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
     9
# Unless required by applicable law or agreed to in writing, software
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    10
# distributed under the License is distributed on an "AS IS" BASIS,
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    12
# See the License for the specific language governing permissions and
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    13
# limitations under the License.
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    14
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    15
__authors__ = [
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    16
    # alphabetical order by last name, please
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    17
    '"David Anderson" <dave@natulte.net>',
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    18
    ]
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    19
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    20
c6bb25fa7f7b Create an error module containing the top-level error class.
David Anderson <david.jc.anderson@gmail.com>
parents:
diff changeset
    21
class Error(Exception):
1835
3f30b7b14c57 Fix indentation to match Melange/Google style.
David Anderson <david.jc.anderson@gmail.com>
parents: 1822
diff changeset
    22
  """Base class for release script exceptions."""
1888
ef350db7f753 Style fixes for release modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1849
diff changeset
    23
  pass
1849
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    24
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    25
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    26
class ObstructionError(Error):
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    27
  """An operation was obstructed by existing data."""
1888
ef350db7f753 Style fixes for release modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1849
diff changeset
    28
  pass
1849
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    29
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    30
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    31
class ExpectationFailed(Error):
f8728d5e2e07 Factor out the Subversion wrapper to a separate module.
David Anderson <david.jc.anderson@gmail.com>
parents: 1835
diff changeset
    32
  """An unexpected state was encountered by an automated step."""
1888
ef350db7f753 Style fixes for release modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1849
diff changeset
    33
  pass
1981
8cfb054b73b2 Factor out input and file utils into io.py.
David Anderson <david.jc.anderson@gmail.com>
parents: 1888
diff changeset
    34
8cfb054b73b2 Factor out input and file utils into io.py.
David Anderson <david.jc.anderson@gmail.com>
parents: 1888
diff changeset
    35
8cfb054b73b2 Factor out input and file utils into io.py.
David Anderson <david.jc.anderson@gmail.com>
parents: 1888
diff changeset
    36
class AbortedByUser(Error):
8cfb054b73b2 Factor out input and file utils into io.py.
David Anderson <david.jc.anderson@gmail.com>
parents: 1888
diff changeset
    37
  """The operation was aborted by the user."""
8cfb054b73b2 Factor out input and file utils into io.py.
David Anderson <david.jc.anderson@gmail.com>
parents: 1888
diff changeset
    38
  pass