Skip to content

Commit

Permalink
Here paicemana is reduced for a workflow of Etherpad
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-mbm committed Jul 1, 2015
1 parent d87b2cf commit ca87f46
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion paicemana/scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import click

from paicemana.textdownload import MarkdownDownload
from paicemana.mdanalyzer import MarkdownAnalyzer
from urllib.error import HTTPError


Expand All @@ -18,7 +19,12 @@ def cli(archive):
if not archive:
raise click.UsageError('try the -h/--help option')
try:
MarkdownDownload(archive)
download = MarkdownDownload(archive)
analyzer = MarkdownAnalyzer(download.filename)
organizer = analyzer.getOrganizer()
translators = ['alexandre-mbm', 'jgpacker', 'vgeorge']
organizer.distribute_for(translators)
print('\n%s\n\n%s\n' % (organizer, organizer.scores()))
except HTTPError as e:
click.echo(e)

2 comments on commit ca87f46

@alexandre-mbm
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Em algumas execuções, senão em todas, a ordem da lista de tradutores importa para um pequeno vício na distribuição dos scores. Mas isso é besteira! Pois esses scores também não fazem uma comparação "humanamente perfeita". Fiquemos com um fator de sorteio. Uma pequena melhoria poderá ser: tornar randômica a ordem dos tradutores.

@alexandre-mbm
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uma pequena melhoria poderá ser: tornar randômica a ordem dos tradutores.

import random
list = ['red', 'white', 'blue']
random.shuffle(list)
print(list)

Ref.: http://ubuntuforums.org/showthread.php?t=555188&p=3394356#post3394356

Please sign in to comment.