Browse Source

Add config example.

Jelmer Vernooij 11 năm trước cách đây
mục cha
commit
ec8a7d495d
1 tập tin đã thay đổi với 13 bổ sung0 xóa
  1. 13 0
      examples/config.py

+ 13 - 0
examples/config.py

@@ -0,0 +1,13 @@
+#!/usr/bin/python
+# Read the config file for a git repository.
+#
+# Example usage:
+#  python examples/config.py
+
+from dulwich.repo import Repo
+
+repo = Repo(".")
+config = repo.get_config()
+
+print config.get("core", "filemode")
+print config.get(("remote", "origin"), "url")