mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
* some fixes for windows
git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@254 efabe8c0-fbe8-4139-b769-b5e6d273206e
This commit is contained in:
parent
b227c1c2e2
commit
066821b011
2 changed files with 10 additions and 3 deletions
|
@ -149,10 +149,10 @@ def init():
|
||||||
if sys.path[0] and not os.path.isdir(sys.path[0]): # i.e. library.zip
|
if sys.path[0] and not os.path.isdir(sys.path[0]): # i.e. library.zip
|
||||||
d = os.path.dirname(sys.path[0])
|
d = os.path.dirname(sys.path[0])
|
||||||
os.chdir(d) # for read presets
|
os.chdir(d) # for read presets
|
||||||
fcs_command = os.path.join('freecell-solver', 'fc-solve.exe')
|
fcs_command = os.path.join('freecell-solver', 'bin', 'fc-solve.exe')
|
||||||
settings.FCS_COMMAND = fcs_command
|
settings.FCS_COMMAND = fcs_command
|
||||||
##f = os.path.join(d, 'freecell-solver', 'presetrc')
|
f = os.path.join('freecell-solver', 'presetrc')
|
||||||
##os.environ['FREECELL_SOLVER_PRESETRC'] = f # defined in prefix.h
|
os.environ['FREECELL_SOLVER_PRESETRC'] = f
|
||||||
if os.name in ('posix', 'nt'):
|
if os.name in ('posix', 'nt'):
|
||||||
try:
|
try:
|
||||||
kw = {'shell': True,
|
kw = {'shell': True,
|
||||||
|
|
|
@ -134,9 +134,16 @@ if os.name == "posix":
|
||||||
|
|
||||||
def win32_getusername():
|
def win32_getusername():
|
||||||
user = os.environ.get('USERNAME','').strip()
|
user = os.environ.get('USERNAME','').strip()
|
||||||
|
try:
|
||||||
|
user = unicode(user, locale.getpreferredencoding())
|
||||||
|
except:
|
||||||
|
user = ''
|
||||||
return user
|
return user
|
||||||
|
|
||||||
def win32_getprefdir(package):
|
def win32_getprefdir(package):
|
||||||
|
portprefdir = 'config' # portable varsion
|
||||||
|
if os.path.isdir(portprefdir):
|
||||||
|
return portprefdir
|
||||||
# %USERPROFILE%, %APPDATA%
|
# %USERPROFILE%, %APPDATA%
|
||||||
hd = os.environ.get('APPDATA')
|
hd = os.environ.get('APPDATA')
|
||||||
if not hd:
|
if not hd:
|
||||||
|
|
Loading…
Add table
Reference in a new issue