Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2008-06-26 03:22:41 (GMT)
committer Chris Ball <cjb@laptop.org>2008-06-26 15:31:23 (GMT)
commitb5e998156170b6187febafc859a58fadf6467244 (patch)
treed645e18384e9db01fb49b9bb563b5b6d001df1eb /src
parent574b4c40811601dd9d0e890173968375b9c45eb3 (diff)
Use os.path.splitext() to get file extensions, not string.strip().
Diffstat (limited to 'src')
-rw-r--r--src/controlpanel/cmd.py2
-rw-r--r--src/controlpanel/gui.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/controlpanel/cmd.py b/src/controlpanel/cmd.py
index a46a0aa..7cb40da 100644
--- a/src/controlpanel/cmd.py
+++ b/src/controlpanel/cmd.py
@@ -55,7 +55,7 @@ def load_modules():
modules = []
for file_name in file_names:
if file_name.endswith('.py') and file_name != '__init__.py':
- module_name = file_name.strip('.py')
+ module_name = os.path.splitext(file_name)[0]
module = __import__('.'.join(subpath) + '.' +
module_name, globals(), locals(),
[module_name])
diff --git a/src/controlpanel/gui.py b/src/controlpanel/gui.py
index b07687f..a1e8876 100644
--- a/src/controlpanel/gui.py
+++ b/src/controlpanel/gui.py
@@ -197,7 +197,7 @@ class ControlPanel(gtk.Window):
for name in names:
if name.endswith('.py') and name != '__init__.py':
- tmp = name.strip('.py')
+ tmp = os.path.splitext(name)[0]
mod = __import__('.'.join(subpath) + '.' + tmp, globals(),
locals(), [tmp])
view_class_str = getattr(mod, 'CLASS', None)
@@ -224,7 +224,7 @@ class ControlPanel(gtk.Window):
for name in names:
if name.endswith('.py') and name != '__init__.py':
- tmp = name.strip('.py')
+ tmp = os.path.splitext(name)[0]
if tmp in options:
mod = __import__('.'.join(subpath) + '.' + tmp,
globals(), locals(), [tmp])