Skip to content

Commit 030e594

Browse files
author
chipperdoodles
committed
fixed 3color atom command for windows
1 parent cbb1dcd commit 030e594

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

threecolor/configs/sysinfo.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

threecolor/manager.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,13 @@ def newpage(batch, pagetype):
167167
def atom():
168168
""" Open project folder with atom editor"""
169169
try:
170-
subprocess.check_call(["atom", instfolder])
170+
if misc.system == 'Windows':
171+
subprocess.check_call(["atom", instfolder], shell=True)
172+
else:
173+
subprocess.check_call(["atom", instfolder])
174+
171175
except OSError as e:
172-
print(e)
173-
subprocess.check_output(["atom", instfolder])
176+
print(os.strerror(e))
174177
print("The atom editor command line tool not installed")
175178

176179

threecolor/tools/misc.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
import os
22
import subprocess
33
import shutil
4+
import platform
45

5-
from ..configs import sysinfo, config
6+
from ..configs import config
67

78
instfolder = config.instfolder
89

910
inst_dir_list = ['content', 'images', 'themes']
1011

1112
content_dir_list = ['book', 'news', 'single']
1213

14+
system = platform.system()
15+
1316
def page_dir(dirname):
1417
ptype_dir = os.path.join(instfolder, 'content', dirname)
1518
return ptype_dir
1619

1720
def open_browser():
18-
if sysinfo.system == 'Windows':
21+
if system == 'Windows':
1922
os.startfile(instfolder['open'])
20-
elif sysinfo.system == 'Darwin':
23+
elif system == 'Darwin':
2124
subprocess.call(["open", instfolder])
2225
else:
2326
try:

0 commit comments

Comments
 (0)