Skip to content

Commit

Permalink
Merge pull request #12 from roedesh/libt-fixes
Browse files Browse the repository at this point in the history
Version 1.0.3
  • Loading branch information
roedesh authored Jun 29, 2018
2 parents 6cc38df + bf43b84 commit 0d19ab9
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 33 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,8 @@ nxstart -n "My new project" -a "John Doe" libnx --clion
Or if you don't use CLion:
```bash
nxstart -n "My new project" -a "John Doe" libnx --no-clion
```
```

## Running tests
Tests can be run with the `pytest` command. If you are contributing code, make sure all tests are green before
submitting a PR.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ Or if you don't use CLion:
$ nxstart -n "My new project" -a "John Doe" libnx --no-clion
Running tests
=============
Tests can be run with the `pytest` command. If you are contributing code, make sure all tests are green before
submitting a PR.
22 changes: 18 additions & 4 deletions nxstart/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import click

from nxstart import app
from nxstart.version import __version__ as version


class Context(object):
"""
Context to be passed to the subcommands.
Context to be passed to the sub-commands.
"""

def __init__(self):
Expand All @@ -24,11 +25,24 @@ def __init__(self):


@click.group()
@click.option('--name', '-n', default=None, prompt='Project name', help='The name of your project')
@click.option('--author', '-a', default=None, prompt='Author name',
help='The full name of the author')
@click.option('--name', '-n', default=None, help='The name of your project')
@click.option('--author', '-a', default=None, help='The full name of the author')
@pass_context
def cli(ctx, name, author):
click.echo("""
# # # # #### ##### ## ##### #####
## # # # # # # # # # #
# # # ## ##### #### # # # # # #
# # # ## # # ###### ##### #
# ## # # # # # # # # # #
# # # # #### # # # # # #
""")
click.echo('v%s - by roedesh <Ruud Schroën>' % version)
if not name:
name = click.prompt('Please enter the name of your project', type=str)
if not author:
author = click.prompt('Please enter your name', type=str)
ctx.name = name
ctx.author = author

Expand Down
1 change: 0 additions & 1 deletion nxstart/filebuilder/libt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def create_libt_project(folder_path, name, author):
Copies the files from templates/base to folder_path and modifies Makefile and source/main.cpp
to include the project name, author name and current date.
:param folder_name: Created folder name
:param folder_path: Path to copy the files to
:param name: Name of the project
:param author: Name of the author
Expand Down
26 changes: 13 additions & 13 deletions nxstart/templates/brewjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ text.show();

// Main loop
game.mainLoop(function () {
// We check pressed input.
var key = input.checkPressed();
// We get current X and Y values of our text.
if (key === input.A) {
// We create a random color and set it to the text.
var r = device.randomNumber(0, 255);
var g = device.randomNumber(0, 255);
var b = device.randomNumber(0, 255);
var color = {R: r, G: g, B: b};
text.color(color);
}
// If + is pressed, the main loop ends.
else if (key === input.Plus) game.exitLoop();
// We check pressed input.
var key = input.checkPressed();
// We get current X and Y values of our text.
if (key === input.A) {
// We create a random color and set it to the text.
var r = device.randomNumber(0, 255);
var g = device.randomNumber(0, 255);
var b = device.randomNumber(0, 255);
var color = {R: r, G: g, B: b};
text.color(color);
}
// If + is pressed, the main loop ends.
else if (key === input.Plus) game.exitLoop();
});

// Execution ends
3 changes: 2 additions & 1 deletion nxstart/templates/libnx/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
# Executables
*.exe
*.out
*.app
*.app
*.nro
1 change: 1 addition & 0 deletions nxstart/templates/libt/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*.i*86
*.x86_64
*.hex
*.nro

# Debug files
*.dSYM/
Expand Down
8 changes: 2 additions & 6 deletions nxstart/templates/libt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ set(CMAKE_CXX_STANDARD 11)

include_directories($ENV{LIBTRANSISTOR_HOME}/lib)
include_directories($ENV{LIBTRANSISTOR_HOME}/include)
include_directories($ENV{DEVKITPRO}/libnx/lib)
include_directories($ENV{DEVKITPRO}/libnx/include)
include_directories($ENV{DEVKITARM})
link_directories($ENV{DEVKITPRO}/libnx/lib)
link_directories($ENV{DEVKITPRO}/libnx/include)
link_directories($ENV{LIBTRANSISTOR_HOME}/bin)
link_directories($ENV{LIBTRANSISTOR_HOME}/lib)
link_directories($ENV{LIBTRANSISTOR_HOME}/include)

add_executable(FOLDER_NAME_PLACEHOLDER source/main.cpp)
1 change: 0 additions & 1 deletion nxstart/tests/test_utils_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ def test_replace_in_file(tmpdir):
'TEXT_PLACEHOLDER': 'NEW_TEXT',
})
assert_file_contains_strings(new_test_file_path, ['NEW_TEXT'])

6 changes: 1 addition & 5 deletions nxstart/utils/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

"""Includes functions for working with the filesystem."""

from os.path import join, dirname

import os
from os.path import join, dirname

import click

Expand Down Expand Up @@ -50,6 +49,3 @@ def check_and_create_directory(folder_path):
raise click.Abort()

os.makedirs(folder_path)



2 changes: 1 addition & 1 deletion nxstart/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.2'
__version__ = '1.0.3'
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ def readme():
'Source': 'https://github.com/roedesh/nxstart',
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development :: Code Generators',
'Topic :: Utilities'
],
)

0 comments on commit 0d19ab9

Please sign in to comment.