Skip to content

Commit

Permalink
Isolated xlwings from Travis (only available on Windows or OS X)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Tremblay <christian.tremblay@servisys.com>
  • Loading branch information
ChristianTremblay committed Dec 8, 2015
1 parent 0969d81 commit f38aa1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
16 changes: 11 additions & 5 deletions BAC0/core/devices/Device.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
import pandas as pd
from datetime import datetime

from xlwings import Workbook, Sheet, Range, Chart

try:
from xlwings import Workbook, Sheet, Range, Chart
_XLWINGS = True
except ImportError:
print('xlwings not installed. If using Windows or OSX, install to get more features.')
_XLWINGS = False

class Device():
"""
Expand Down Expand Up @@ -338,10 +342,12 @@ def save_to_excel(self):

his['Notes'] = self.notes
df = pd.DataFrame(his).fillna(method='ffill').fillna(method='bfill')

wb = Workbook()
Range('A1').value = df

if _XLWINGS:
wb = Workbook()
Range('A1').value = df
else:
df.to_csv()

def __setitem__(self, point_name, value):
"""
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pandas>=0.14
numpy>=1.9
bacpypes>=0.13
bokeh>=0.10.0
xlwings>=0.4
bokeh>=0.10.0

0 comments on commit f38aa1a

Please sign in to comment.