Skip to content

Commit

Permalink
Merge pull request #813 from LukeTapekhin/heavy_refactor
Browse files Browse the repository at this point in the history
desktop updater removes build folder
  • Loading branch information
LukeTapekhin authored Sep 11, 2017
2 parents 0b7851a + 9f69536 commit f0d716a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lingvodoc/views/v2/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ def basic_sync(request):
new_entries = list()
old_langs = dict()
langs = list()

# todo: rework diff
for table in [Locale, User, Client, BaseGroup, TranslationGist, TranslationAtom, Field, Group, Language]:
curr_server = server[table.__tablename__]
curr_existing = existing[table.__tablename__]
Expand Down Expand Up @@ -325,6 +327,8 @@ def all_toc(request):

@view_config(route_name='diff_server', renderer='json', request_method='POST')
def diff_server(request):

# todo: rework diff
tmp_list = DBSession.query(ObjectTOC).yield_per(10000).enable_eagerloads(False)
existing = [row2dict(entry) for entry in tmp_list]
req = request.json_body
Expand All @@ -340,6 +344,8 @@ def diff_server(request):

@view_config(route_name='diff_group_server', renderer='json', request_method='POST')
def diff_group_server(request):

# todo: rework diff
upload = list()
groups = DBSession.query(Group).all()
existing = [entry.id for entry in groups]
Expand Down Expand Up @@ -418,6 +424,8 @@ def diff_desk(request):
userblobs = list()
translationgist = list()
translationatom = list()

# todo: rework diff
for entry in server:
if entry['table_name'] == 'language':
language.append(entry)
Expand Down
4 changes: 4 additions & 0 deletions update1.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ class Example(QWidget):
self.progress.setValue(60)
self.loop.processEvents(QEventLoop.ExcludeUserInputEvents)

if os.path.exists('source/build'):
remove('source/build')
proc = Popen([pythonw, setup, 'install'], stdout=PIPE, stderr=PIPE, cwd='%s\\source' % cur_path)
streamdata = proc.communicate()[1]
rc = proc.returncode
Expand All @@ -432,6 +434,8 @@ class Example(QWidget):
)
return
proc.terminate()
if os.path.exists('source/build'):
remove('source/build')
self.changetext("Updating in progress. Setup complete. Starting database update")
self.progress.setValue(65)
self.loop.processEvents(QEventLoop.ExcludeUserInputEvents)
Expand Down

0 comments on commit f0d716a

Please sign in to comment.