Skip to content

Commit 8b7a41e

Browse files
committed
Add pre-commit fixes
1 parent c6d8c39 commit 8b7a41e

20 files changed

+115
-119
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ jobs:
4040
run: docker image prune -af
4141
- name: Test with pytest
4242
run: |
43-
python -m unittest discover -v -s test -p "test*.py"
43+
python -m unittest discover -v -s test -p "test*.py"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
*.pyc
33
build/
44
*.egg-info/
5-
.vscode
5+
.vscode

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ A python client library for ChannelFinder.
66

77
The python channelfinder client library can be configured by setting up a `channelfinderapi.conf` file in the following locations
88

9-
`/etc/channelfinderapi.conf`
10-
`~/.channelfinderapi.conf`
11-
`channelfinderapi.conf`
9+
`/etc/channelfinderapi.conf`
10+
`~/.channelfinderapi.conf`
11+
`channelfinderapi.conf`
1212

13-
The example preferences:
13+
The example preferences:
1414

1515
```
16-
cat ~/channelfinderapi.conf
17-
[DEFAULT]
18-
BaseURL=http://localhost:8080/ChannelFinder
19-
username=MyUserName
20-
password=MyPassword
16+
cat ~/channelfinderapi.conf
17+
[DEFAULT]
18+
BaseURL=http://localhost:8080/ChannelFinder
19+
username=MyUserName
20+
password=MyPassword
2121
```
22-
22+
2323
## Development
2424

2525
To install with dependancies for testing.
@@ -38,4 +38,4 @@ To run all tests:
3838

3939
```bash
4040
python -m unittest discover -v -s test -p "test*.py"
41-
```
41+
```

channelfinder/CFDataTypes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def cmp(a, b):
2222
class Channel(object):
2323
# TODO
2424
# updated the properties data structure by splitting it into 2 dict
25-
25+
2626
# All the attributes are private and read only in an attempt to make the channel object immutable
2727
Name = property(lambda self: self.__Name)
2828
Owner = property(lambda self: self.__Owner)
@@ -42,7 +42,7 @@ def __init__(self, name, owner, properties=None, tags=None):
4242
self.__Owner = str(owner).strip()
4343
self.Properties = properties
4444
self.Tags = tags
45-
45+
4646
## TODO don't recreate the dictionary with every get
4747
def getProperties(self):
4848
"""
@@ -85,10 +85,10 @@ def __init__(self, name, owner, value=None):
8585
self.Value = value
8686
if self.Value:
8787
str(value).strip()
88-
89-
def __cmp__(self, *arg, **kwargs):
88+
89+
def __cmp__(self, *arg, **kwargs):
9090
if arg[0] is None:
91-
return 1
91+
return 1
9292
return cmp((self.Name, self.Value), (arg[0].Name, arg[0].Value))
9393

9494

@@ -99,7 +99,7 @@ def __init__(self, name, owner):
9999
"""
100100
self.Name = str(name).strip()
101101
self.Owner = str(owner).strip()
102-
102+
103103
def __cmp__(self, *arg, **kwargs):
104104
if arg[0] is None:
105105
return 1

channelfinder/ChannelFinderClient.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,39 +97,39 @@ def set(self, **kwds):
9797
set(channels = [Channel])
9898
>>> set(channels=[{'name':'chName1','owner':'chOwner'},{'name':'chName2','owner':'chOwner'}])
9999
>>> set(channels=[{'name':'chName1','owner':'chOwner', 'tags':[...], 'properties':[...]}, {...}])
100-
100+
101101
set(tag = Tag)
102102
>>> set(tag={'name':'tagName','owner':'tagOwner'})
103-
103+
104104
set(tags = [Tag])
105105
>>> set(tags=[{'name':'tag1','tagOwner'},{'name':'tag2','owner':'tagOwner'}])
106-
106+
107107
set(property = Property )
108108
>>> set(property={'name':'propertyName','owner':'propertyOwner'})
109-
109+
110110
set(properties = [Property])
111-
>>> set(properties=[{'name':'prop1','owner':'propOwner'},'prop2','propOwner'])
112-
111+
>>> set(properties=[{'name':'prop1','owner':'propOwner'},'prop2','propOwner'])
112+
113113
*** IMP NOTE: Following operation are destructive ***
114114
*** if you simply want to append a tag or property use the update operation***
115-
115+
116116
set(tag=Tag, channelName=String)
117117
>>> set(tag={'name':'tagName','owner':'tagOwner'}, channelName='chName')
118118
# will create/replace specified Tag
119119
# and add it to the channel with the name = channelName
120-
120+
121121
set(tag=Tag, channelNames=[String])
122122
>>> set (tag={'name':'tagName','owner':'tagOwner'}, channelNames=['ch1','ch2','ch3'])
123-
# will create/replace the specified Tag
123+
# will create/replace the specified Tag
124124
# and add it to the channels with the names specified in channelNames
125125
# and delete it from all other channels
126-
126+
127127
set(property=Property, channelNames=[String])
128128
>>> set(property={'name':'propName','owner':'propOwner','value':'propValue'}, channels=[...])
129129
# will create/replace the specified Property
130130
# and add it to the channels with the names specified in channels
131131
# and delete it from all other channels
132-
132+
133133
"""
134134
if len(kwds) == 1:
135135
self.__handleSingleAddParameter(**kwds)

channelfinder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
from .CFDataTypes import *
2-
from .ChannelFinderClient import *
2+
from .ChannelFinderClient import *

channelfinder/_conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ def __loadConfig():
3737
'channelfinderapi.conf'
3838
])
3939
return cf
40-
basecfg=__loadConfig()
40+
basecfg=__loadConfig()

channelfinder/cfMonitorTest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
2:'Major '}
3232

3333

34-
def main():
34+
def main():
3535
requiredOpts = ['initial-file', 'final-file']
3636
usage = "usage: %prog -i initial-file -f final-file directory "
3737
parser = OptionParser(usage=usage)
@@ -54,7 +54,7 @@ def main():
5454
def mainRun(opts, args):
5555
for directory in args:
5656
initialFile = os.path.normpath(directory + '/' + opts.initialFile)
57-
iHostName, iIocName = getArgsFromFilename(initialFile)
57+
iHostName, iIocName = getArgsFromFilename(initialFile)
5858
finalFile = os.path.normpath(directory + '/' + opts.finalFile)
5959
fHostName, fIocName = getArgsFromFilename(finalFile)
6060
if getPVNames(initialFile) != getPVNames(finalFile):
@@ -66,7 +66,7 @@ def mainRun(opts, args):
6666
Touch the initial file and check channelfinder
6767
'''
6868
touch(initialFile)
69-
sleep(2)
69+
sleep(2)
7070
check(pvNames, iHostName, iIocName)
7171
'''
7272
Touch the final file and check channelfinder
@@ -110,7 +110,7 @@ def getArgsFromFilename(completeFilePath):
110110
iocName = match.group(1)
111111
else:
112112
iocName = None
113-
return hostName, iocName
113+
return hostName, iocName
114114

115115
def getPVNames(completeFilePath, pattern=None):
116116
try:
@@ -125,7 +125,7 @@ def getPVNames(completeFilePath, pattern=None):
125125
return None
126126
finally:
127127
f.close()
128-
128+
129129
if __name__ == '__main__':
130-
main()
130+
main()
131131
pass

channelfinder/cfPropertyManager/CFPropertyManager.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,3 @@ def run(dbl_path,cfg_path):
241241
print("IOError: " + e.message)
242242
else:
243243
startClient()
244-
245-
246-
247-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .CFPropertyManager import *
1+
from .CFPropertyManager import *

0 commit comments

Comments
 (0)