Skip to content

Commit

Permalink
fix: version num
Browse files Browse the repository at this point in the history
  • Loading branch information
jgirardet committed Aug 30, 2020
1 parent 67f2325 commit b647197
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 21 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[tool.briefcase]
project_name = "MyCartable"
bundle = "coding.cacahuete"
version = "0.9.0"
version = "0.9.2"
url = "https://github.com/jgirardet/MyCartable"
license = "GNU General Public License v3 (GPLv3)"
author = 'Jimmy Girardet'
author_email = "[email protected]"

[tool.briefcase.app.mycartable]
formal_name = "MyCartable"
description = "Toute le travail de l'école, à un seul endroit !!"
icon = "src/data/icons/appicon"
description = "My first application"
#icon = "src/mycartable/resources/mycartable"
sources = ['src/mycartable']
requires = ['pyside2==5.15.0',
'pony>=0.7.11,<0.8',
Expand Down
17 changes: 9 additions & 8 deletions src/mycartable/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


import package.database
from pony.orm import DBException
from pony.orm import DBException, db_session


def main_init_database(filename=None, prod=False):
Expand All @@ -42,10 +42,10 @@ def main_init_database(filename=None, prod=False):
filename=filename, create_db=create_db
)

# if not prod:
# from tests.python.factory import populate_database
#
# populate_database()
if not prod:
from tests.python.factory import populate_database

populate_database()

return package.database.db

Expand Down Expand Up @@ -83,9 +83,10 @@ def create_singleton_instance(prod=False):
ui_manager = UiManager()
databaseObject.ui = ui_manager

# if not prod:
# databaseObject.anneeActive = 2019
# databaseObject.currentMatiere = 2
if not prod:
databaseObject.anneeActive = 2019
with db_session:
databaseObject.currentPage = databaseObject.db.Page.select().first().id

return databaseObject, ui_manager

Expand Down
40 changes: 30 additions & 10 deletions tests/python/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@

#
from PySide2.QtGui import QColor
from package.default_matiere import MATIERE_GROUPE, MATIERES
from package.default_matiere import (
MATIERE_GROUPE,
MATIERES,
MATIERE_GROUPE_BASE,
MATIERES_BASE,
)
from pony.orm import db_session, flush

#
Expand Down Expand Up @@ -388,15 +393,30 @@ def f_style(
def populate_database(matieres_list=MATIERES, nb_page=100):
user = db.Utilisateur(nom="Lenom", prenom="Leprenom")
annee = Annee(id=2019, niveau="cm1", user=user)
Annee(id=2018, niveau="ce2", user=user)
[db.GroupeMatiere(**x, annee=annee.id) for x in MATIERE_GROUPE]
flush()
matieres = [db.Matiere(**x) for x in matieres_list]
flush()
#
for m in matieres:
for i in range(3):
f_activite(matiere=m.id)
groupes = []
compteur = 0
for groupe in MATIERE_GROUPE_BASE:
gr = GroupeMatiere(annee=annee, bgColor=groupe["bgColor"], nom=groupe["nom"])
for mat in MATIERES_BASE:
if mat["groupe"] == groupe["id"]:
m = Matiere(groupe=gr, nom=mat["nom"])
compteur += 1
ac = Activite(matiere=m, nom="mdomak")
page = Page(titre="mojkù", activite=ac)
groupes.append(gr)

# for groupe in groupes:
# self.reApplyGroupeDegrade(groupe.id)

# Annee(id=2018, niveau="ce2", user=user)
# [db.GroupeMatiere(**x, annee=annee.id) for x in MATIERE_GROUPE]
# flush()
# matieres = [db.Matiere(**x) for x in matieres_list]
# flush()
# #
# for m in matieres:
# for i in range(3):
# f_activite(matiere=m.id)


#
Expand Down

0 comments on commit b647197

Please sign in to comment.