Code Monkey home page Code Monkey logo

rogue_scores's Introduction

rogue_scores

Build status Coverage status Pypi package https://img.shields.io/pypi/dm/rogue_scores.png

rogue_scores is an online Rogue leaderboard with its upload script.

Install

[sudo] pip install rogue_scores

The script as well as the Web server work with both Python 2.x and 3.x.

Upgrade with:

[sudo] pip install -U rogue_scores

Usage

Read the docs.

This repository is Dokku-ready: you just need to set up persistent storage to not lose scores between deployments and it should run without anymore configuration.

If you just want the upload script, install the package and run it:

rogue_scores

It’ll ask you which server to use the first time, and remember it.

Contributing

All contributions are welcomed. Please open an issue describing the problem as well as your Python version and OS. If you can contribute code, fork this repo and run make deps to set up your local environment. Use make check for simple tests and make check-versions for the full test suite. If you can, add a failing test showing the bug. Commit your changes and open a pull request on this repo.

rogue_scores's People

Contributors

bfontaine avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

rogue_scores's Issues

Better JSON format.

Looking at rogue source code, you should be able to parse line with something such as:

    regex = re.compile('^\S+\s+(\S+)\s+([^\s:]+):'                                                                                                                    
                       '\s+killed on level (\d+) by (a )?(\w+).$')                                                                                                         

    parts = regex.match(str(l).strip())                                                                                                                               

    try:                                                                                                                                                              
        return (parts.group(2), int(parts.group(1)), int(parts.group(3)),                                                                                             
                parts.group(5))                                                                                                                                       
    except ValueError:                                                                                                                                                
        return None   

It will return user's name, score, level and killer.
And so your JSON should store these information instead of the whole sentence about what killed you.

Edit: fixed missing ? in regexp.

Fix the scores file patch

It sets it to /var/rogue/rogue.scr but /var is not writable without sudo. We need to find a location when one can write without sudo. Using $HOME/.rogue.scr would need to write a script to generate the patch and replace $HOME with the appropriate path (update: or just use sed).

DistributionNotFound: requests>=2.3.0

@jbyunes got this error.

Installation:

Downloading/unpacking rogue-scores
  Downloading rogue_scores-0.0.6.tar.gz
  Running setup.py (path:/private/tmp/pip_build_root/rogue-scores/setup.py) egg_info for package rogue-scores

    warning: no files found matching '*.md'
    warning: no previously-included files found matching '*.pyc'
Requirement already satisfied (use --upgrade to upgrade): requests>=2.3.0 in /Library/Python/2.7/site-packages (from rogue-scores)
Installing collected packages: rogue-scores
  Running setup.py install for rogue-scores

    warning: no files found matching '*.md'
    warning: no previously-included files found matching '*.pyc'
    Installing rogue_scores script to /usr/local/bin
Successfully installed rogue-scores
Cleaning up...

Running:

 Traceback (most recent call last):
  File "/usr/local/bin/rogue_scores", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
    working_set.require(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: requests>=2.3.0

Python version: 2.7
Pip version: 1.5.6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.