Author: jkupec
Date: Mon Feb 25 14:48:49 2008
New Revision: 8901
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8901&view=rev
Log:
- fixed rnc scheme for xmlout
- sync with OutXML
- removed type attribute of <progress> - missing value will indicate a
'still-alive' notification
Modified:
trunk/zypper/src/output/OutXML.cc
trunk/zypper/src/output/xmlout.rnc
Modified: trunk/zypper/src/output/OutXML.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/OutXML.cc?rev=8901&r1=8900&r2=8901&view=diff
==============================================================================
--- trunk/zypper/src/output/OutXML.cc (original)
+++ trunk/zypper/src/output/OutXML.cc Mon Feb 25 14:48:49 2008
@@ -114,7 +114,9 @@
cout << " name=\"" << xmlEncode(label) << "\"";
if (done)
cout << " done=\"" << error << "\"";
- else if (value >= 0)
+ // print value only if it is known (percentage progress)
+ // missing value means 'is-alive' notification
+ else if (value >= 0)
cout << " value=\"" << value << "\"";
cout << "/>" << endl;
}
@@ -152,9 +154,9 @@
{
cout << "" << endl;
+ << " percent=\"-1\""
+ << " rate=\"-1\""
+ << "/>" << endl;
}
void OutXML::dwnldProgress(const zypp::Url & uri,
@@ -165,7 +167,7 @@
<< " url=\"" << xmlEncode(uri.asString()) << "\""
<< " percent=\"" << value << "\""
<< " rate=\"" << rate << "\""
- << ">" << endl;
+ << "/>" << endl;
}
void OutXML::dwnldProgressEnd(const zypp::Url & uri, int rate, bool error)
@@ -174,7 +176,7 @@
<< " url=\"" << xmlEncode(uri.asString()) << "\""
<< " rate=\"" << rate << "\""
<< " done=\"" << error << "\""
- << ">" << endl;
+ << "/>" << endl;
}
void OutXML::prompt(PromptId id,
Modified: trunk/zypper/src/output/xmlout.rnc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/xmlout.rnc?rev=8901&r1=8900&r2=8901&view=diff
==============================================================================
--- trunk/zypper/src/output/xmlout.rnc (original)
+++ trunk/zypper/src/output/xmlout.rnc Mon Feb 25 14:48:49 2008
@@ -15,29 +15,21 @@
update-element )+
}
-progress-elements = ( progress-alive | progress-percentage | progress-done )
+progress-elements = ( progress-element | progress-done )
# todo - restrict and specialize progress by type
-progress-percentage =
+progress-element =
element progress {
attribute id { xsd:string },
attribute name { xsd:string },
- attribute type { "percentage" },
- attribute value { xsd:integer }
- }
-
-progress-alive =
- element progress {
- attribute id { xsd:string },
- attribute name { xsd:string },
- attribute type { "alive" },
+ attribute value { xsd:integer }?
}
progress-done =
element progress {
attribute id { xsd:string },
attribute name { xsd:string },
- attribute done { xsd:boolean }, # 0 on success, 1 on error
+ attribute done { xsd:boolean } # 0 on success, 1 on error
}
download-progress-elements = ( download-progress-element | download-progress-done )
@@ -53,12 +45,11 @@
element download {
attribute url { xsd:string },
attribute rate { xsd:integer }, # download rate in bytes per second
- attribute done { xsd:boolean }, # 0 on success, 1 on error
+ attribute done { xsd:boolean } # 0 on success, 1 on error
}
message-element =
element message {
- attribute id { xsd:string }
attribute type { "info" | "warning" | "error" }, # considering yet another type "result", maybe a separate <result> element
text
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org