import sys, re, urllib2, json, netrc, email.Parser, optparse
-version="2.4"
+version="2.5"
class Update:
"Encapsulate dictionaries describing a project metadata update."
("Changes", "c", "changelog"), # Release
("Hide", "x", "hidden_from_frontpage"), # Release
("Release-Tag-List", "t", "tag_list"), # Release
- # Note: Release Focus is no longer a real Freecode field.
- # We remap it below.
- ("Release-Focus", "r", "release_focus"), # Release
)
- # Conventional values for release focus
- focus_values = (
- "Initial freecode announcement",
- "Documentation",
- "Code cleanup",
- "Minor feature enhancements",
- "Major feature enhancements",
- "Minor bugfixes",
- "Major bugfixes",
- "Minor security fixes",
- "Major security fixes",
- )
# Which attributes have project scope, all others have release scupe
projectwide = ('name',
'description',
# Hidden flag special handling
if "hidden_from_frontpage" in data:
data["hidden_from_frontpage"] = data["hidden_from_frontpage"] in ("Y", "y")
- # Release-Focus field special handling.
- if "release_focus" in data:
- if data["release_focus"] in '123456789':
- data["release_focus"] = FreecodeMetadataFactory.focus_values[int(data["release_focus"])-1]
- if data["release_focus"] not in FreecodeMetadataFactory.focus_values:
- raise FreecodeSessionException("Invalid release focus")
- if "tag_list" not in data:
- data["tag_list"] = data["release_focus" ]
- else:
- data["tag_list"].append(data["release_focus" ])
- del data["release_focus"]
# Now merge in the URLs, doing symbol substitution
urllist = []
for (label, furl) in urls.items():
</entry>
</row>
-<row>
-<entry>Release-Focus:</entry><entry>Release</entry>
-<entry>-r</entry><entry>--release-focus</entry>
-<entry>
-<para>Purpose of this release. See the table of release-focus types
-below.</para>
-</entry>
-</row>
-
<row>
<entry>Release-Tag-List:</entry> <entry>Release</entry>
<entry>-t</entry><entry>--tag-list</entry>
project. Only the Tag-List, Changes, Version, Release-Focus, and Hide
fields are actually stored for each version.</para>
-<para>Here are the release-focus types. Either the string or the
-integer is acceptable. Case of the string is significant.</para>
-
-<informaltable>
-<tgroup cols='2' rowsep='1'>
-<tbody>
-<row><entry>Initial freecode announcement</entry><entry>1</entry></row>
-<row><entry>Documentation</entry><entry>2</entry></row>
-<row><entry>Code cleanup</entry><entry>3</entry></row>
-<row><entry>Minor feature enhancements</entry><entry>4</entry></row>
-<row><entry>Major feature enhancements</entry><entry>5</entry></row>
-<row><entry>Minor bugfixes</entry><entry>6</entry></row>
-<row><entry>Major bugfixes</entry><entry>7</entry></row>
-<row><entry>Minor security fixes</entry><entry>8</entry></row>
-<row><entry>Major security fixes</entry><entry>9</entry></row>
-</tbody>
-</tgroup>
-</informaltable>
-
<para>The following elements of Freecode project metadata cannot yet
be modified using this tool: <varname>name</varname>,
<varname>translation list</varname>, <varname>programming