Skip to content

Commit

Permalink
#10 - package improved, still not good
Browse files Browse the repository at this point in the history
  • Loading branch information
geckon committed Dec 8, 2018
1 parent 51e00d5 commit ed3aab4
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 9 deletions.
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
There are some configurable options - see the default config file
(.2-n_solitaire.conf). All options should be described there including default
values which will be used if not specified otherwise. The game will search for
the configuration file in the following locations (in this order):
- current working directory
- home directory
the configuration file in the following locations (in this order):\n
- current working directory\n
- home directory\n
- directory specified by TWN_SOLITAIRE_CONF_DIR environment variable
Expand All @@ -47,7 +47,7 @@

setup(
name='twn-solitaire',
version='0.0.1a1',
version='0.0.1a3',
packages=['twnsol', ],
scripts=['solitaire.py', ],
url='https://github.com/geckon/2-n_solitaire',
Expand All @@ -59,5 +59,6 @@
"pygame == 1.9.4",
"toml == 0.10.0",
],
include_package_data=True,
package_data={'': ['LICENSE', 'assets'],},
package_dir={'requests': 'requests'}
)
30 changes: 29 additions & 1 deletion twnsol/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,33 @@
CONST dictionary is provided for any module to use.
"""

import logging
import os

#def get_assets_dir():
# """Return path to the assets directory.
#
# It's either /usr/share/twn_solitaire/assets or ./assets. If none of
# these exist, throw FileNotFoundError.
# """
# locations = (
# '/usr/share/twn_solitaire',
# os.curdir,
# )
#
# for loc in locations:
# assets_dir = os.path.join(loc, 'assets')
# if os.path.isdir(assets_dir):
# logging.debug('Assets dir found: %s', assets_dir)
# return assets_dir
#
# raise FileNotFoundError('Assets directory not found.')

HERE = os.path.dirname(os.path.abspath(__file__))

TOP_DIR = os.path.join(HERE, '..')

ASSETS_DIR = os.path.join(TOP_DIR, 'assets')

CONST = {
'game': {
Expand All @@ -28,7 +55,8 @@
},
'font': {
'path': {
'default': './assets/Jellee-Roman/Jellee-Roman.otf',
'default': os.path.join(ASSETS_DIR,
'Jellee-Roman/Jellee-Roman.otf'),
},
'size': {
'normal': 18,
Expand Down

0 comments on commit ed3aab4

Please sign in to comment.