summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2011-04-11 12:05:15 +0200
committerJulian Andres Klode <jak@debian.org>2011-04-11 12:05:15 +0200
commit91603aac68593f6749428825d7e94b75873927f4 (patch)
treef8509ad7809a71af710fc0644d69547c435bfdbd
parenta9161a7868bc7e97fa0938dd4d5eab5ae379e3ee (diff)
downloadpython-apt-91603aac68593f6749428825d7e94b75873927f4.tar.gz
doc/examples: Add example on how to get architecture names (LP: #194374)
-rw-r--r--debian/changelog1
-rw-r--r--doc/examples/architecture.py12
2 files changed, 13 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 2032eeae..ae57e18b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ python-apt (0.8.0~exp2) UNRELEASED; urgency=low
(time_to_str accepts unsigned long, time_rfc1123 long long, y2k31-correct).
* apt.progress: Use long for ETA, natural type for size (LP: #377375)
* aptsources/sourceslist.py: s/aptsource.py/sourceslist.py/ (LP: #309603)
+ * doc/examples: Add example on how to get architecture names (LP: #194374)
-- Julian Andres Klode <jak@debian.org> Wed, 06 Apr 2011 09:46:52 +0200
diff --git a/doc/examples/architecture.py b/doc/examples/architecture.py
new file mode 100644
index 00000000..75afb2d1
--- /dev/null
+++ b/doc/examples/architecture.py
@@ -0,0 +1,12 @@
+import apt_pkg
+
+
+def main():
+ apt_pkg.init_config()
+
+ print "Native architecture:", apt_pkg.config["APT::Architecture"]
+ print "All architectures:", apt_pkg.config.value_list("APT::Architectures")
+
+
+if __name__ == '__main__':
+ main()