Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Rename players to aimmo (#652)
Browse files Browse the repository at this point in the history
* Rename players to aimmo

* players -> aimmo
  • Loading branch information
mrniket authored Jul 9, 2018
1 parent 7a48f95 commit b54b397
Show file tree
Hide file tree
Showing 61 changed files with 60 additions and 60 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ test-bin/
aimmo-game/.hypothesis

# Unity Build
players/static/unity/**
aimmo/static/unity/**

# Frontend generated files
players/static/react/
players/templates/players/game_ide.html
aimmo/static/react/
aimmo/templates/players/game_ide.html

# Mac Generated Files
.DS_Store
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
graft players/static
graft players/templates
graft aimmo/static
graft aimmo/templates
2 changes: 1 addition & 1 deletion aimmo-game-creator/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def main():
logging.basicConfig(level=logging.DEBUG)
game_manager_class = GAME_MANAGERS[os.environ.get('GAME_MANAGER', 'local')]
game_manager = game_manager_class(os.environ.get('GAME_API_URL',
'http://localhost:8000/players/api/games/'))
'http://localhost:8000/aimmo/api/games/'))
game_manager.run()


Expand Down
2 changes: 1 addition & 1 deletion aimmo-game-worker/test-initialise.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if len(sys.argv) > 1:
avatar_file = sys.argv[1]
else:
avatar_file = '../players/avatar_examples/dumb_avatar.py'
avatar_file = '../aimmo/avatar_examples/dumb_avatar.py'

with open(avatar_file) as avatar_fileobj:
avatar_data = avatar_fileobj.read()
Expand Down
2 changes: 1 addition & 1 deletion aimmo-game/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def run_game(port):

print("Running game...")
settings = pickle.loads(os.environ['settings'])
api_url = os.environ.get('GAME_API_URL', 'http://localhost:8000/players/api/games/')
api_url = os.environ.get('GAME_API_URL', 'http://localhost:8000/aimmo/api/games/')
generator = getattr(map_generator, settings['GENERATOR'])(settings)
player_manager = AvatarManager()
game_state = generator.get_game_state(player_manager)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion players/_version.py → aimmo/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_config():
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = "aimmo-"
cfg.versionfile_source = "players/_version.py"
cfg.versionfile_source = "aimmo/_version.py"
cfg.verbose = False
return cfg

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion players/autoconfig.py → aimmo/autoconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# copyright notice and these terms. You must not misrepresent the origins of this
# program; modified versions of the program must be marked as such and not
# identified as the original program.
'''Players autoconfig'''
'''aimmo autoconfig'''

DEFAULT_SETTINGS = {
'AUTOCONFIG_INDEX_VIEW': 'aimmo/home',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion players/forms.py → aimmo/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.forms import ModelForm

from players.models import Game
from aimmo.models import Game


class AddGameForm(ModelForm):
Expand Down
2 changes: 1 addition & 1 deletion players/game_renderer.py → aimmo/game_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from django.shortcuts import render
from players import app_settings
from aimmo import app_settings


def render_game(request, game):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from importlib import import_module
from django.conf import settings
from django.contrib.auth.models import User
from players.views import code as code_view
from aimmo.views import code as code_view


def _nth_dirname(path, n):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('players', '0001_initial'),
('aimmo', '0001_initial'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from django.conf import settings
from django.db import migrations, models, transaction, IntegrityError

import players.models
import aimmo.models


def migrate_data_forward(apps, schema_editor):
Player = apps.get_model("players", "Player")
Avatar = apps.get_model("players", "Avatar")
Game = apps.get_model("players", "Game")
Player = apps.get_model("aimmo", "Player")
Avatar = apps.get_model("aimmo", "Avatar")
Game = apps.get_model("aimmo", "Game")

if Player.objects.count() == 0:
return
Expand All @@ -23,8 +23,8 @@ def migrate_data_forward(apps, schema_editor):


def migrate_data_backward(apps, schema_editor):
Player = apps.get_model("players", "Player")
Avatar = apps.get_model("players", "Avatar")
Player = apps.get_model("aimmo", "Player")
Avatar = apps.get_model("aimmo", "Avatar")

if Avatar.objects.count() == 0:
return
Expand All @@ -42,7 +42,7 @@ class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('players', '0002_auto_20160601_1914'),
('aimmo', '0002_auto_20160601_1914'),
]

operations = [
Expand All @@ -51,15 +51,15 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('code', models.TextField()),
('auth_token', models.CharField(default=players.models.generate_auth_token, max_length=24)),
('auth_token', models.CharField(default=aimmo.models.generate_auth_token, max_length=24)),
],
),
migrations.CreateModel(
name='Game',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=100)),
('auth_token', models.CharField(default=players.models.generate_auth_token, max_length=24)),
('auth_token', models.CharField(default=aimmo.models.generate_auth_token, max_length=24)),
('public', models.BooleanField(default=True)),
('can_play', models.ManyToManyField(related_name='playable_games', to=settings.AUTH_USER_MODEL)),
('owner', models.ForeignKey(related_name='owned_games', to=settings.AUTH_USER_MODEL, null=True)),
Expand All @@ -68,7 +68,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='avatar',
name='game',
field=models.ForeignKey(to='players.Game'),
field=models.ForeignKey(to='aimmo.Game'),
),
migrations.AddField(
model_name='avatar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('players', '0003_auto_20160802_1418'),
('aimmo', '0003_auto_20160802_1418'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('players', '0004_auto_20160808_1511'),
('aimmo', '0004_auto_20160808_1511'),
]

operations = [
Expand Down Expand Up @@ -43,7 +43,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='levelattempt',
name='game',
field=models.OneToOneField(to='players.Game'),
field=models.OneToOneField(to='aimmo.Game'),
),
migrations.AddField(
model_name='levelattempt',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('players', '0005_auto_20160808_1545'),
('aimmo', '0005_auto_20160808_1545'),
]

operations = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('players', '0006_game_static_data'),
('aimmo', '0006_game_static_data'),
]

operations = [
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion players/models.py → aimmo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.contrib.auth.models import User
from django.db import models

from players import app_settings
from aimmo import app_settings

GAME_GENERATORS = [
('Main', 'Open World'), # Default
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django import template

from players import app_settings
from aimmo import app_settings

register = template.Library()

Expand Down
2 changes: 1 addition & 1 deletion players/tests.py → aimmo/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.core.urlresolvers import reverse
from django.test import Client, TestCase

from players import models, app_settings
from aimmo import models, app_settings

app_settings.GAME_SERVER_URL_FUNCTION = lambda game_id: ('base %s' % game_id, 'path %s' % game_id)
app_settings.GAME_SERVER_PORT_FUNCTION = lambda game_id: 0
Expand Down
2 changes: 1 addition & 1 deletion players/urls.py → aimmo/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.views.generic import TemplateView
from django.views.generic import RedirectView

from players import views
from aimmo import views
from app_settings import preview_user_required

urlpatterns = [
Expand Down
2 changes: 1 addition & 1 deletion players/views.py → aimmo/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from django.middleware.csrf import get_token

from models import Avatar, Game, LevelAttempt
from players import forms, game_renderer
from aimmo import forms, game_renderer
from app_settings import get_users_for_new_game, preview_user_required

LOGGER = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion aimmo_runner/minikube.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def create_creator_yaml():
"""
orig_path = os.path.join(BASE_DIR, 'aimmo-game-creator', 'rc-aimmo-game-creator.yaml')
with open(orig_path) as orig_file:
content = yaml.safe_load(orig_file.read().replace('latest', 'test').replace('REPLACE_ME', 'http://%s:8000/players/api/games/' % get_ip()))
content = yaml.safe_load(orig_file.read().replace('latest', 'test').replace('REPLACE_ME', 'http://%s:8000/aimmo/api/games/' % get_ip()))
return content


Expand Down
4 changes: 2 additions & 2 deletions aimmo_runner/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ max-line-length = 160
[versioneer]
VCS = git
style = pep440-pre
versionfile_source = ../players/_version.py
versionfile_build = ../players/_version.py
versionfile_source = ../aimmo/_version.py
versionfile_build = ../aimmo/_version.py
tag_prefix =
parentdir_prefix = aimmo-
2 changes: 1 addition & 1 deletion aimmo_runner/tests/test_minikube_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def test_game_creator_function_creates_correct_game_url(self, mocked_get_ip_func
"""
created_yaml = create_creator_yaml()
self.assertEqual(created_yaml['spec']['template']['spec']['containers'][0]['env'][1]['value'],
'http://127.0.0.1:8000/players/api/games/')
'http://127.0.0.1:8000/aimmo/api/games/')
2 changes: 1 addition & 1 deletion all_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def main():

def run_tests(compute_coverage):
def app_name(app):
return 'players' if app == '' else app
return 'aimmo' if app == '' else app

failed_apps = []
for app in APPS:
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This section describes the whole game architecture and how things are structured

## Components

[The UI (`players` directory)](ui/README.md)
[The UI (`aimmo` directory)](ui/README.md)

A Django app used for the front-end and database interaction. There are static Unity build files to render the game in browser.

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/ui/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## The UI (`players` directory)
## The UI (`aimmo` directory)

---

Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/deployment-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

We use Travis for contiguous integration. Travis CI is the first step in our integration pipeline. Each time a push is made Travis runs all our tests and sends the coverage reports for display to [coveralls.io](https://coveralls.io/).

Our package Django app `players` is deployed to [Pypi](https://pypi.python.org/pypi/aimmo) and we use [Versioneer](https://github.com/warner/python-versioneer) for package versioning.
Our package Django app `aimmo` is deployed to [Pypi](https://pypi.python.org/pypi/aimmo) and we use [Versioneer](https://github.com/warner/python-versioneer) for package versioning.

The rest of the components are Dockerized. Travis CI automatically recognizes the **Dockerfiles** inside of each of the modules and pushes the newly created images to the **Docker Hub Registry**. Each of the components are then pulled automatically by the Google Cloud Container Engine.

Expand Down
6 changes: 3 additions & 3 deletions docs/testing/test-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
**Prior to playing the game:**
* The level exists already. Check it by navigating to the Watch->Level.
* If required, you can login using your details (admin:admin default).
* You are at the correct URL (/players/watch_level/1/).
* You are at the correct URL (/aimmo/watch_level/1/).
* It consists of **_five_** square boxes lined horizontally. The leftmost is at (-2,0), the right most at (2,0).
* There is no player on the screen. Nothing is happening.

**Programming the game:**
* Program the game (Program-> Level1) and end up in the correct URL (players/program_level/1/).
* Program the game (Program-> Level1) and end up in the correct URL (aimmo/program_level/1/).
* Ensure the code will be able to move the character to the right 4 times. Default code will suffice (see below to copy).
* Click the save button. Now go to Watch->Level1 via the menu (or press the Watch hotlink above the editor).
* See the character moving. It should stop when it gets to red box at (2,0).
Expand All @@ -43,7 +43,7 @@ class Avatar(object):
### Check the following:
**Prior to playing the game:**
* Ensure there are no custom games running (Watch menu).
* Go to Program->Create a new game (/players/games/new). Select any name, select yourself in the 'Can Play' menu.
* Go to Program->Create a new game (/aimmo/games/new). Select any name, select yourself in the 'Can Play' menu.
* Ensure 'Generator' is set to "Open World". Save, watch.
* A grid should show with an avatar moving around randomly.
* The score location should move randomly from time to time (depending on settings).
Expand Down
6 changes: 3 additions & 3 deletions example_project/example_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'players',
'aimmo',
'django_forms_bootstrap',
)

Expand All @@ -95,9 +95,9 @@
}
}

LOGIN_URL = '/players/accounts/login/'
LOGIN_URL = '/aimmo/accounts/login/'

LOGIN_REDIRECT_URL = '/players/'
LOGIN_REDIRECT_URL = '/aimmo/'

MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
Expand Down
4 changes: 2 additions & 2 deletions game_frontend/djangoBundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const shell = require('shelljs')
const fs = require('fs')

const file = Path.join(__dirname, './index.html')
const outDir = Path.join(__dirname, '../players/static/react')
const outDir = Path.join(__dirname, '../aimmo/static/react')

const options = {
outDir,
Expand All @@ -16,7 +16,7 @@ const options = {
cache: process.env.NODE_ENV === 'production'
}

const templateFolder = Path.resolve(Path.join(__dirname, '../players/templates/players'))
const templateFolder = Path.resolve(Path.join(__dirname, '../aimmo/templates/players'))

const bundler = new Bundler(file, options)

Expand Down
2 changes: 1 addition & 1 deletion game_frontend/src/redux/api/constants.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const API_PATH = '/players/api/'
export const API_PATH = '/aimmo/api/'
2 changes: 1 addition & 1 deletion game_frontend/src/redux/features/Editor/epics.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const postCodeEpic = (action$, store, { api }) =>
.pipe(
ofType(types.POST_CODE_REQUEST),
api.post(
`/players/api/code/${store.getState().game.connectionParameters.id}/`,
`/aimmo/api/code/${store.getState().game.connectionParameters.id}/`,
() => ({ code: store.getState().editor.code })
),
map(response => actions.postCodeReceived()),
Expand Down
Loading

0 comments on commit b54b397

Please sign in to comment.