Skip to content

Commit

Permalink
Attempting to find the data files on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ConceptJunkie committed Jun 3, 2020
1 parent 737ad36 commit fdec4b1
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion rpn/makeHelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12235,7 +12235,7 @@ def main( ):
unitsFile = Path( getUserDataPath( ) + os.sep + 'units.pckl.bz2' )

if not unitsFile.is_file( ):
print( 'Please run "makeUnits" to initialize the unit conversion data files.' )
print( 'Please run "rpnMakeUnits" (or makeUnits.py) to initialize the unit conversion data files.' )
sys.exit( 0 )

from rpn.rpnConstantOperators import constantOperators
Expand Down
2 changes: 1 addition & 1 deletion rpn/rpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ def main( ):
os.chdir( getUserDataPath( ) ) # SkyField doesn't like running in the root directory

if not unitsFile.is_file( ):
print( 'Please run "makeUnits" to initialize the unit conversion data files.' )
print( 'Please run "rpnMakeUnits" (or makeUnits.py) to initialize the unit conversion data files.' )
sys.exit( 0 )

helpFile = Path( getUserDataPath( ) + os.sep + 'help.pckl.bz2' )
Expand Down
34 changes: 17 additions & 17 deletions rpn/rpnNumberTheory.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,11 +958,11 @@ def makeEulerBrick( _a, _b, _c ):
return sorted( result )


# //******************************************************************************
# //
# // getNthFibonorial
# //
# //******************************************************************************
#******************************************************************************
#
# getNthFibonorial
#
#******************************************************************************

@oneArgFunctionEvaluator( )
def getNthFibonorial( n ):
Expand All @@ -974,13 +974,13 @@ def getNthFibonorial( n ):
return result


# //******************************************************************************
# //
# // getExtendedGCD
# //
# // adapted from http://ccgi.gladman.plus.com/wp/?page_id=1500
# //
# //******************************************************************************
#******************************************************************************
#
# getExtendedGCD
#
# adapted from http://ccgi.gladman.plus.com/wp/?page_id=1500
#
#******************************************************************************

@twoArgFunctionEvaluator( )
def getExtendedGCD( a, b ):
Expand All @@ -1003,11 +1003,11 @@ def getExtendedGCD( a, b ):
return ( u, v, a ) if a > 0 else ( -u, -v, -a )


# //******************************************************************************
# //
# // getLCM
# //
# //******************************************************************************
#******************************************************************************
#
# getLCM
#
#******************************************************************************

def getLCMOfList( args ):
if isinstance( args[ 0 ], ( list, RPNGenerator ) ):
Expand Down
2 changes: 1 addition & 1 deletion rpn/rpnUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def getDataPath( ):
@lru_cache( 1 )
def getUserDataPath( ):
'''Returns the path for the cache files.'''
if os.name == 'nt':
if sys.platform in ( 'win32', 'darwin' ):
userDataPath = getDataPath( )
else:
userDataPath = os.path.expanduser( '~' ) + os.sep + '.' + g.dataDir
Expand Down
4 changes: 2 additions & 2 deletions rpn/rpnVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# //******************************************************************************

PROGRAM_NAME = 'rpnChilada'
PROGRAM_VERSION = '8.3.0'
PROGRAM_VERSION_NAME = '8.3.0'
PROGRAM_VERSION = '8.3.1'
PROGRAM_VERSION_NAME = '8.3.1'
COPYRIGHT_MESSAGE = 'copyright (c) 2020 (1988), Rick Gutleber ([email protected])'

if PROGRAM_VERSION != PROGRAM_VERSION_NAME:
Expand Down
2 changes: 1 addition & 1 deletion rpn/testRPN.py
Original file line number Diff line number Diff line change
Expand Up @@ -5459,7 +5459,7 @@ def main( ):
unitsFile = Path( getUserDataPath( ) + os.sep + 'units.pckl.bz2' )

if not unitsFile.is_file( ):
print( 'Please run "makeUnits" to initialize the unit conversion data files.' )
print( 'Please run "rpnMakeUnits" (or makeUnits.py) to initialize the unit conversion data files.' )
sys.exit( 0 )

helpFile = Path( getUserDataPath( ) + os.sep + 'help.pckl.bz2' )
Expand Down
9 changes: 4 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def read( *paths ):
setup(
name = 'rpnChilada',
version = PROGRAM_VERSION_NAME,
#description = 'command-line RPN calculator with arbitrary precision',
description = 'command-line RPN calculator',
long_description =
'''
Expand All @@ -50,7 +49,7 @@ def read( *paths ):
800 unique operators. rpnChilada supports lists, but not matrices.
rpnChilada comes with integrated help, which isn't complete, but has at
least a basic description of every operator, and over 1300 built-in
least a basic description of every operator, and over 1500 built-in
examples. Help now includes descriptions for constants and units as well,
although a lot of these still need to be filled in.
Expand Down Expand Up @@ -116,9 +115,9 @@ def read( *paths ):
'console_scripts': [
'rpn = rpn.rpn:main',
'rpnChilada = rpn.rpn:main',
#'makeRPNHelp = rpn.makeHelp:main',
#'makeRPNUnits = rpn.makeUnits:main',
#'prepareRPNPrimeData = rpn.preparePrimeData:main',
'rpnMakeHelp = rpn.makeHelp:main',
'rpnMakeUnits = rpn.makeUnits:main',
#'rpnPreparePrimeData = rpn.preparePrimeData:main',
'testRPN = rpn.testRPN:main',
],
}
Expand Down

0 comments on commit fdec4b1

Please sign in to comment.