Skip to content
Snippets Groups Projects
Commit 120612c8 authored by Nathan Letwory's avatar Nathan Letwory
Browse files

Clean up unused variables.

Some whitespace edits.
parent 6c41390f
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ def _read_credentials(): ...@@ -38,7 +38,7 @@ def _read_credentials():
pwfile = bpy.utils.user_resource('CONFIG', 'rffi', True) pwfile = bpy.utils.user_resource('CONFIG', 'rffi', True)
try: try:
pwmod = imp.find_module('rffi_credentials',[pwfile]) pwmod = imp.find_module('rffi_credentials',[pwfile])
except ImportError as e: except ImportError:
_write_credentials('', '') _write_credentials('', '')
pwmod = imp.find_module('rffi_credentials',[pwfile]) pwmod = imp.find_module('rffi_credentials',[pwfile])
try: try:
...@@ -46,7 +46,7 @@ def _read_credentials(): ...@@ -46,7 +46,7 @@ def _read_credentials():
bpy.rffi_user = user_creds.user bpy.rffi_user = user_creds.user
bpy.rffi_hash = user_creds.hash bpy.rffi_hash = user_creds.hash
bpy.rffi_creds_found = True bpy.rffi_creds_found = True
except ImportError as e: except ImportError:
# doesn't exist yet, write template # doesn't exist yet, write template
_write_credentials('', '') _write_credentials('', '')
pwfile = bpy.utils.user_resource('CONFIG', 'rffi', True) pwfile = bpy.utils.user_resource('CONFIG', 'rffi', True)
...@@ -82,15 +82,13 @@ def _xmlsessions_to_oresessions(sessions, stage=None): ...@@ -82,15 +82,13 @@ def _xmlsessions_to_oresessions(sessions, stage=None):
def update_session_list(session_list, ore): def update_session_list(session_list, ore):
while(len(session_list) > 0): while(len(session_list) > 0):
session_list.remove(0) session_list.remove(0)
for s in bpy.ore_active_session_queue: for s in bpy.ore_active_session_queue:
session_list.add() session_list.add()
session = session_list[-1] session = session_list[-1]
session.name = s.title + ' [' + str(s.percentageComplete()) + '% complete]' session.name = s.title + ' [' + str(s.percentageComplete()) + '% complete]'
def update_complete_session_list(ore): def update_complete_session_list(ore):
all_sessions = []
bpy.ore_active_session_queue = bpy.ore_cancelled_sessions bpy.ore_active_session_queue = bpy.ore_cancelled_sessions
update_session_list(ore.rejected_sessions, ore) update_session_list(ore.rejected_sessions, ore)
bpy.ore_active_session_queue = bpy.ore_active_sessions bpy.ore_active_session_queue = bpy.ore_active_sessions
...@@ -99,29 +97,29 @@ def update_complete_session_list(ore): ...@@ -99,29 +97,29 @@ def update_complete_session_list(ore):
update_session_list(ore.pending_sessions, ore) update_session_list(ore.pending_sessions, ore)
bpy.ore_active_session_queue = bpy.ore_completed_sessions bpy.ore_active_session_queue = bpy.ore_completed_sessions
update_session_list(ore.completed_sessions, ore) update_session_list(ore.completed_sessions, ore)
bpy.ore_complete_session_queue = [] bpy.ore_complete_session_queue = []
bpy.ore_complete_session_queue.extend(bpy.ore_pending_sessions) bpy.ore_complete_session_queue.extend(bpy.ore_pending_sessions)
bpy.ore_complete_session_queue.extend(bpy.ore_active_sessions) bpy.ore_complete_session_queue.extend(bpy.ore_active_sessions)
bpy.ore_complete_session_queue.extend(bpy.ore_completed_sessions) bpy.ore_complete_session_queue.extend(bpy.ore_completed_sessions)
bpy.ore_complete_session_queue.extend(bpy.ore_cancelled_sessions) bpy.ore_complete_session_queue.extend(bpy.ore_cancelled_sessions)
bpy.ore_active_session_queue = bpy.ore_complete_session_queue bpy.ore_active_session_queue = bpy.ore_complete_session_queue
update_session_list(ore.all_sessions, ore) update_session_list(ore.all_sessions, ore)
def check_status(ore): def check_status(ore):
bpy.errors = [] bpy.errors = []
if bpy.rffi_creds_found == False and bpy.rffi_hash == '': if bpy.rffi_creds_found == False and bpy.rffi_hash == '':
bpy.errors.append('missing_creds') bpy.errors.append('missing_creds')
if '' in {ore.title, ore.longdesc, ore.shortdesc}: if '' in {ore.title, ore.longdesc, ore.shortdesc}:
bpy.errors.append('missing_desc') bpy.errors.append('missing_desc')
bpy.infoError = True bpy.infoError = True
set_status('username', bpy.rffi_hash=='' and ore.username=='') set_status('username', bpy.rffi_hash=='' and ore.username=='')
set_status('password', bpy.rffi_hash=='' and ore.password=='') set_status('password', bpy.rffi_hash=='' and ore.password=='')
set_status('title', ore.title=='') set_status('title', ore.title=='')
set_status('longdesc', ore.longdesc=='') set_status('longdesc', ore.longdesc=='')
set_status('shortdesc', ore.shortdesc=='') set_status('shortdesc', ore.shortdesc=='')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment