Skip to content
Snippets Groups Projects
  1. May 18, 2016
    • ulif's avatar
      Set lowest log level by default. · 6d15eab7
      ulif authored
      As we can only increase verbosity with commandline flags, we
      should set the least verbose log level by default.
      6d15eab7
  2. May 17, 2016
  3. May 12, 2016
  4. May 11, 2016
    • ulif's avatar
      Add `--dice-sides` option. · 6bfdbd2e
      ulif authored
      This argument makes sense together with ``realdice`` randomsource
      and tells how many sides the dice we use have. Six by default.
      6bfdbd2e
    • ulif's avatar
      Add a (dummy) argparser updater for real dice. · 44aa926c
      ulif authored
      The RealDiceRandomSource will support own commandline arguments. This
      is handled by an own classmethod called `update_argparser` that is
      called upon initialization of diceware.
      44aa926c
    • ulif's avatar
      Update docs. · f90da2ec
      ulif authored
      f90da2ec
    • ulif's avatar
      Update docs. · 37b21f14
      ulif authored
      37b21f14
    • ulif's avatar
      Allow plugins to work with the argparser. · 03fa1a63
      ulif authored
      If plugins want to work with their own commandline args, we allow
      this by calling their `update_argparser` methods. This has to be a
      classmethod, if it exists.
      03fa1a63
  5. May 09, 2016
    • ulif's avatar
      Allow a `section` parameter for `get_config_dict()`. · c4827f8b
      ulif authored
      In config files we normally lookup a ``[diceware]`` section.
      
      For plugins, however, it might be helpful to be able to parse also
      other sections. Together with the new `defaults_dict` argument
      they could implement their own set of options more easily.
      c4827f8b
    • ulif's avatar
      Add `defaults_dict` parameter for `get_config_dict()`. · 1c55aa6a
      ulif authored
      We can now give a custom dict to use for defaults.
      
      This is the first step to make `get_config_dict()` usable also
      for plugins.
      1c55aa6a
  6. May 08, 2016
  7. May 07, 2016
  8. May 05, 2016
    • dwcoder's avatar
      Fix issue 23 · 5ca58b56
      dwcoder authored
      This commit fixes #23
      
      Add the `string.strip()` function to the `get_config_dict()`, to remove
      inverted commas around string values in the diceware.ini file.
      The strip removes both `"` and `'`.
      Add unit test to ensure the line:
      
          delimiter=" "
      
      in the diceware.ini file is being parsed correctly as a space.
      5ca58b56
  9. Apr 29, 2016
    • dwcoder's avatar
      Change capitalize to caps · 81d83afe
      dwcoder authored
      This commit fixes issue #21.
      Change all occurences of the option `capitalize` to `caps` in
      __init.py__.
      
      Make the same change in the test_diceware.py.
      Add a unit test that checks the output of main() after setting the
      `caps = off` in the .diceware.ini.
      81d83afe
  10. Apr 28, 2016
  11. Apr 25, 2016
    • ulif's avatar
      Provide a logger, API-wise. · 70f91b65
      ulif authored
      Add a common place where components can write messages to. Any
      userinterface can decide, what messages should be visible
      (depending on their severity).
      70f91b65
  12. Apr 24, 2016
  13. Apr 20, 2016
    • ulif's avatar
      pep8. · db9165e5
      ulif authored
      Use multiples of 4 as indent, shorten overlong lines and fix
      other minor things to keep pep8-conformity.
      db9165e5
  14. Apr 19, 2016
    • dwcoder's avatar
      Put calculations in right place · a08516d7
      dwcoder authored
      Move the calculations out of the `pre_check()` function.
      Also do smarter checks:
        - If len(sequence) == 1, we don't need any rolls. In this case, just
          return sequence[0]
        - If len(sequence) is a factor of dice_sides, we only need one roll
          along with the modulo operator.
        - For everything else, just require one extra roll, bringing it to a
          total of 2 rolls. This should remove a little bit of the edge bias
          introduced by the modulo
      Run the `pre_check()` function after the calculations have been done.
      
      For the unit tests:
        - remove the function `test_choice_len_too_short()`;
          we no longer have to raise an exception when the sequence length is
          too short.
        - Write new tests for the cases where `dice_sides = 6` and `len(sequence)`:
           - 1
           - 2,3
           - 4,5
      a08516d7
  15. Apr 17, 2016
    • dwcoder's avatar
      Add modulo functionality · 36089112
      dwcoder authored
      Add an if to the pre_check that catches cases where there are less items
      to choose from than sides on the die. If this is the case, we can still
      pick items, but we have to use a modulo.
      Pick the `num_rolls` so that the result generated after rolling is larger
       than `100*len(sequence)`.
      The `pre_check()` function now has to return the modified `num_rolls` as
      well as a boolean to indicate whether modulo needs to be applied on the
      result.
      36089112
    • ulif's avatar
      Update copyright year. · 60ec799f
      ulif authored
      60ec799f
  16. Apr 16, 2016
  17. Apr 15, 2016
  18. Apr 14, 2016
  19. Apr 13, 2016
  20. Mar 22, 2016
  21. Mar 20, 2016
  22. Nov 16, 2015
    • ulif's avatar
      Rename default wordlist from "en_8k" to "en". · b51cadeb
      ulif authored
      Normally, it would be more concise to use the more declarative name.
      "en_8k" tells, how many terms we find in this wordlist. But as the
      wordlist names are used in the CLI and users will normally simply
      look for a wordlist in their language, it can help to keep the name
      of the "default" list for each language short.
      
      We pick the 8K lists for "default" (and not the "original" 6^5
      lists), because we assume that normally people will use diceware
      without dice. Also most other sources of randomness will most
      probably work on a 2^x basis rather than in 6^x (and therefore
      have better use for 8k lists over other ones).
      b51cadeb
  23. Nov 14, 2015
  24. Nov 13, 2015
Loading