Skip to content

Commit

Permalink
Changed from CSV to mdanalyzer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-mbm committed Jun 28, 2015
1 parent 3d4f440 commit f36d055
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
28 changes: 11 additions & 17 deletions ghi-create.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,27 @@
#
# @ alexandre-mbm ‒ Alexandre Magno ‒ [email protected]

translators = ['alexandre-mbm', 'jgpacker', 'vgeorge']

milestone = 1 # 256 (1), 257 (2)
label = 'revisão' # tradução, revisão, movimento, conserto
filename = 'revisoes.csv' # traducoes.csv, revisoes.csv

filename = 'archive-4205.md'

repo_user = 'OSMBrasil'
repo_name = 'semanario'

from github3 import login, GitHub
from paicemana.mdanalyzer import MarkdownAnalyzer

cards = [
{ 'section': 'Events', 'translator': 'jgpacker'},
{ 'section': 'Humanitarian OSM', 'translator': 'jgpacker'},
{ 'section': 'Maps', 'translator': 'jgpacker'},
{ 'section': 'Software', 'translator': 'jgpacker'},
{ 'section': 'Did you know...', 'translator': 'jgpacker'},
{ 'section': 'Other "geo" things', 'translator': 'vgeorge'}
]

cards = []
analyzer = MarkdownAnalyzer(filename)
organizer = analyzer.getOrganizer()
organizer.distribute_for(translators)

import csv
with open(filename, newline='') as csvfile:
spamreader = csv.DictReader(csvfile, delimiter='|')
for row in spamreader:
cards.append(row)
for section in organizer.sections:
print(section.score, section.translator, section.reviser, section.name)

#exit(0)
exit(0)

from getpass import getpass, getuser
import sys
Expand Down
2 changes: 1 addition & 1 deletion paicemana/mdanalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __repr__(self):
def __len__(self):
return len(self.sections)

class TranslatorsSpinner(object):
class TranslatorsSpinner(object): # TODO deactivate it?

def __init__(self, array):
self.index = 0
Expand Down

0 comments on commit f36d055

Please sign in to comment.