X Tutup
Skip to content

Commit 8bc9df7

Browse files
committed
Use xdg module instead of custom XDG logic
1 parent c68d210 commit 8bc9df7

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,14 @@ your config file as **~/.config/bpython/config** (i.e.
155155
Dependencies
156156
============
157157
* Pygments
158-
* requests
159158
* curtsies >= 0.3.3
160159
* greenlet
160+
* requests
161+
* xdg
161162
* Sphinx >= 1.5 (optional, for the documentation)
162163
* babel (optional, for internationalization)
163-
* watchdog (optional, for monitoring imported modules for changes)
164164
* jedi (optional, for experimental multiline completion)
165+
* watchdog (optional, for monitoring imported modules for changes)
165166

166167
bpython-urwid
167168
-------------

bpython/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import locale
44
from itertools import chain
55
from configparser import ConfigParser
6+
from xdg import BaseDirectory
67

78
from .autocomplete import AutocompleteModes
89

@@ -34,8 +35,7 @@ def supports_box_chars():
3435

3536
def get_config_home():
3637
"""Returns the base directory for bpython's configuration files."""
37-
xdg_config_home = os.environ.get("XDG_CONFIG_HOME", "~/.config")
38-
return os.path.join(xdg_config_home, "bpython")
38+
return os.path.join(BaseDirectory.xdg_config_home, "bpython")
3939

4040

4141
def default_config_path():

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ curtsies >=0.3.3
33
greenlet
44
requests
55
setuptools
6+
xdg

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def git_describe_to_python_version(version):
174174
"curtsies >=0.3.3",
175175
"greenlet",
176176
"wcwidth",
177+
"xdg",
177178
]
178179

179180
extras_require = {

0 commit comments

Comments
 (0)
X Tutup