Skip to content

Commit 856a8f8

Browse files
author
lachlan-00
committed
Allow -e on all platforms. Update readme to reflect -r help
1 parent c8be2fc commit 856a8f8

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ optional arguments:
8888
-v, --version show version, filename and exit
8989
-et, --edittypes Edit the list of types and formats
9090
-t, --types Show the current list of types and formats
91-
-r, --recursive Search the source folder recursively for files
91+
-r, --recursive Recursively search your source directory.
92+
WARNING: Ensure you use the correct path as this
93+
WILL move all files from your selected types.
9294
-st SPECIFIC_TYPES [SPECIFIC_TYPES ...], --specific-types SPECIFIC_TYPES [SPECIFIC_TYPES ...]
9395
Move all file extensions, given in the args list, in
9496
the current directory into the Specific Folder

classifier/classifier.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020

2121
VERSION = 'Classifier 1.99dev'
2222
DIRCONFFILE = '.classifier.conf'
23-
OS = os.name
24-
if OS == 'nt':
23+
PLATFORM = sys.platform
24+
if PLATFORM == 'darwin':
25+
CONFIG = os.path.join(os.path.expanduser('~'), '.classifier.conf')
26+
elif PLATFORM == 'nt':
2527
CONFIG = os.getenv('userprofile') + '/classifier.conf'
26-
elif OS == 'posix':
28+
elif PLATFORM == 'linux':
2729
CONFIG = xdg_config_dirs[0] + '/classifier.conf'
2830

2931
def main():
@@ -186,7 +188,12 @@ def run(self):
186188
print(key, '\n', value)
187189
return False
188190
if self.args.edittypes:
189-
subprocess.Popen(['xdg-open', CONFIG])
191+
if PLATFORM == 'darwin':
192+
subprocess.call(('open', CONFIG))
193+
elif PLATFORM == 'nt':
194+
os.startfile(CONFIG)
195+
elif PLATFORM == 'linux':
196+
subprocess.Popen(['xdg-open', CONFIG])
190197
return False
191198
if bool(self.args.specific_folder) ^ bool(self.args.specific_types):
192199
print(

0 commit comments

Comments
 (0)