rsclib 0.66__py3-none-any.whl → 0.68__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
rsclib/execute.py CHANGED
@@ -4,19 +4,23 @@
4
4
  # Web: http://www.runtux.com Email: office@runtux.com
5
5
  # All rights reserved
6
6
  # ****************************************************************************
7
- # This library is free software; you can redistribute it and/or modify
8
- # it under the terms of the GNU Library General Public License as
9
- # published by the Free Software Foundation; either version 2 of the
10
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
11
13
  #
12
- # This program is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
16
  #
17
- # You should have received a copy of the GNU Library General Public
18
- # License along with this program; if not, write to the Free Software
19
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
20
24
  # ****************************************************************************
21
25
 
22
26
  from __future__ import print_function
@@ -112,6 +116,8 @@ class Exec (Log):
112
116
  popen_stdin = None
113
117
  if stdin is not None:
114
118
  popen_stdin = PIPE
119
+ if isinstance (stdin, str):
120
+ stdin = stdin.encode ('utf-8')
115
121
  p = Popen \
116
122
  ( args
117
123
  , stdin = popen_stdin
rsclib/grepmime.py CHANGED
@@ -1,23 +1,26 @@
1
1
  #!/usr/bin/python
2
- # -*- coding: iso-8859-1 -*-
3
2
  # Copyright (C) 2007-17 Dr. Ralf Schlatterbeck Open Source Consulting.
4
3
  # Reichergasse 131, A-3411 Weidling.
5
4
  # Web: http://www.runtux.com Email: office@runtux.com
6
5
  # All rights reserved
7
6
  # ****************************************************************************
8
- # This library is free software; you can redistribute it and/or modify
9
- # it under the terms of the GNU Library General Public License as
10
- # published by the Free Software Foundation; either version 2 of the
11
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
12
13
  #
13
- # This program is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
17
16
  #
18
- # You should have received a copy of the GNU Library General Public
19
- # License along with this program; if not, write to the Free Software
20
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
21
24
  # ****************************************************************************
22
25
 
23
26
  import re
rsclib/hexdump.py CHANGED
@@ -4,19 +4,23 @@
4
4
  # Web: http://www.runtux.com Email: office@runtux.com
5
5
  # All rights reserved
6
6
  # ****************************************************************************
7
- # This library is free software; you can redistribute it and/or modify
8
- # it under the terms of the GNU Library General Public License as
9
- # published by the Free Software Foundation; either version 2 of the
10
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
11
13
  #
12
- # This program is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
16
  #
17
- # You should have received a copy of the GNU Library General Public
18
- # License along with this program; if not, write to the Free Software
19
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
20
24
  # ****************************************************************************
21
25
 
22
26
  from __future__ import print_function
rsclib/inductance.py CHANGED
@@ -1,23 +1,26 @@
1
1
  #!/usr/bin/python
2
- # -*- coding: iso-8859-1 -*-
3
2
  # Copyright (C) 2011-17 Dr. Ralf Schlatterbeck Open Source Consulting.
4
3
  # Reichergasse 131, A-3411 Weidling.
5
4
  # Web: http://www.runtux.com Email: office@runtux.com
6
5
  # All rights reserved
7
6
  # ****************************************************************************
8
- # This library is free software; you can redistribute it and/or modify
9
- # it under the terms of the GNU Library General Public License as
10
- # published by the Free Software Foundation; either version 2 of the
11
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
12
13
  #
13
- # This program is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
17
16
  #
18
- # You should have received a copy of the GNU Library General Public
19
- # License along with this program; if not, write to the Free Software
20
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
21
24
  # ****************************************************************************
22
25
 
23
26
  from __future__ import print_function
@@ -36,7 +39,7 @@ def L_s (l, d, n) :
36
39
  """ Inductance in H for an air-cored cylindrical flat-winded coil
37
40
  of length l and diameter d with n windings. Both l and d are in m.
38
41
  The first publication that tried to give a formula for this type
39
- of coils is
42
+ of coils is
40
43
  Nagaoka, Hantaro (1909-05-06) "The Inductance Coefficients of
41
44
  Solenoids." 27. Journal of the College of Science, Imperial
42
45
  University, Tokyo, Japan. p. 18.
@@ -479,7 +482,7 @@ def induction (d, n, d_w, l = 0, pitch = 0, f = 0, material = 'cu') :
479
482
  # Single Turn, special handling
480
483
  >>> print ("%3.2f" % (induction (5, 1, 0.0235, 0.0235, f=1.9e6)*1e6))
481
484
  17.10
482
-
485
+
483
486
  # From http://www.g3ynh.info/zdocs/comps/part_2.html
484
487
  >>> print ("%3.2f" % (induction (0.06366, 1, 0.00163, 0.00163, f=5e6)*1e9))
485
488
  150.50
rsclib/isdn.py CHANGED
@@ -4,19 +4,23 @@
4
4
  # Web: http://www.runtux.com Email: office@runtux.com
5
5
  # All rights reserved
6
6
  # ****************************************************************************
7
- # This library is free software; you can redistribute it and/or modify
8
- # it under the terms of the GNU Library General Public License as
9
- # published by the Free Software Foundation; either version 2 of the
10
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
11
13
  #
12
- # This program is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
16
  #
17
- # You should have received a copy of the GNU Library General Public
18
- # License along with this program; if not, write to the Free Software
19
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
20
24
  # ****************************************************************************
21
25
 
22
26
  from __future__ import print_function
@@ -288,7 +292,7 @@ class ISDN_Port (autosuper) :
288
292
  if k [0] != '_' and v is not None
289
293
  )
290
294
  # end def __str__
291
-
295
+
292
296
  def __repr__ (self) :
293
297
  return "%s (%s)" % (self.__class__.__name__, str (self))
294
298
  # end def __name__
rsclib/iter_recipes.py CHANGED
@@ -4,19 +4,23 @@
4
4
  # Web: http://www.runtux.com Email: office@runtux.com
5
5
  # All rights reserved
6
6
  # ****************************************************************************
7
- # This library is free software; you can redistribute it and/or modify
8
- # it under the terms of the GNU Library General Public License as
9
- # published by the Free Software Foundation; either version 2 of the
10
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
11
13
  #
12
- # This program is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
16
  #
17
- # You should have received a copy of the GNU Library General Public
18
- # License along with this program; if not, write to the Free Software
19
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
20
24
  # ****************************************************************************
21
25
 
22
26
  # Some recipes for iterating, some from
@@ -194,7 +198,8 @@ except ImportError :
194
198
  try:
195
199
  b.append (next (x))
196
200
  except StopIteration:
197
- yield b
201
+ if b:
202
+ yield b
198
203
  return
199
204
  yield b
200
205
  b = []
rsclib/lc_resonator.py CHANGED
@@ -1,23 +1,26 @@
1
1
  #!/usr/bin/python
2
- # -*- coding: iso-8859-1 -*-
3
2
  # Copyright (C) 2014-17 Dr. Ralf Schlatterbeck Open Source Consulting.
4
3
  # Reichergasse 131, A-3411 Weidling.
5
4
  # Web: http://www.runtux.com Email: office@runtux.com
6
5
  # All rights reserved
7
6
  # ****************************************************************************
8
- # This library is free software; you can redistribute it and/or modify
9
- # it under the terms of the GNU Library General Public License as
10
- # published by the Free Software Foundation; either version 2 of the
11
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
12
13
  #
13
- # This program is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
17
16
  #
18
- # You should have received a copy of the GNU Library General Public
19
- # License along with this program; if not, write to the Free Software
20
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
21
24
  # ****************************************************************************
22
25
 
23
26
  from __future__ import print_function
rsclib/nmap.py CHANGED
@@ -4,19 +4,23 @@
4
4
  # Web: http://www.runtux.com Email: office@runtux.com
5
5
  # All rights reserved
6
6
  # ****************************************************************************
7
- # This library is free software; you can redistribute it and/or modify
8
- # it under the terms of the GNU Library General Public License as
9
- # published by the Free Software Foundation; either version 2 of the
10
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
11
13
  #
12
- # This program is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
16
  #
17
- # You should have received a copy of the GNU Library General Public
18
- # License along with this program; if not, write to the Free Software
19
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
20
24
  # ****************************************************************************
21
25
 
22
26
  from __future__ import print_function
@@ -572,7 +576,7 @@ def main () :
572
576
  else :
573
577
  for fn in args :
574
578
  p.parse (open (fn))
575
-
579
+
576
580
  ip_map = {}
577
581
  for ipname in opt.ip_map :
578
582
  try :
rsclib/ocf.py CHANGED
@@ -4,19 +4,23 @@
4
4
  # Web: http://www.runtux.com Email: office@runtux.com
5
5
  # All rights reserved
6
6
  # ****************************************************************************
7
- # This library is free software; you can redistribute it and/or modify
8
- # it under the terms of the GNU Library General Public License as
9
- # published by the Free Software Foundation; either version 2 of the
10
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
11
13
  #
12
- # This program is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
16
  #
17
- # You should have received a copy of the GNU Library General Public
18
- # License along with this program; if not, write to the Free Software
19
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
20
24
  # ****************************************************************************
21
25
 
22
26
  from __future__ import print_function
@@ -134,7 +138,7 @@ class Resource (Exec) :
134
138
  OCF_NOT_RUNNING = 7
135
139
 
136
140
  ocf_variables = \
137
- [ 'OCF_RA_VERSION_MAJOR'
141
+ [ 'OCF_RA_VERSION_MAJOR'
138
142
  , 'OCF_RA_VERSION_MINOR'
139
143
  , 'OCF_ROOT'
140
144
  , 'OCF_RESOURCE_INSTANCE'
rsclib/pycompat.py CHANGED
@@ -4,19 +4,23 @@
4
4
  # Web: http://www.runtux.com Email: office@runtux.com
5
5
  # All rights reserved
6
6
  # ****************************************************************************
7
- # This library is free software; you can redistribute it and/or modify
8
- # it under the terms of the GNU Library General Public License as
9
- # published by the Free Software Foundation; either version 2 of the
10
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
11
13
  #
12
- # This program is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
16
  #
17
- # You should have received a copy of the GNU Library General Public
18
- # License along with this program; if not, write to the Free Software
19
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
20
24
  # ****************************************************************************
21
25
  #
22
26
  # Python compatibility. Some code taken from Armin Ronacher's excellent
@@ -1,23 +1,26 @@
1
1
  #!/usr/bin/python
2
- # -*- coding: iso-8859-1 -*-
3
- # Copyright (C) 2007-17 Dr. Ralf Schlatterbeck Open Source Consulting.
2
+ # Copyright (C) 2007-24 Dr. Ralf Schlatterbeck Open Source Consulting.
4
3
  # Reichergasse 131, A-3411 Weidling.
5
4
  # Web: http://www.runtux.com Email: office@runtux.com
6
5
  # All rights reserved
7
6
  # ****************************************************************************
8
- # This library is free software; you can redistribute it and/or modify
9
- # it under the terms of the GNU Library General Public License as
10
- # published by the Free Software Foundation; either version 2 of the
11
- # License, or (at your option) any later version.
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
12
13
  #
13
- # This program is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU Library General Public License for more details.
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
17
16
  #
18
- # You should have received a copy of the GNU Library General Public
19
- # License along with this program; if not, write to the Free Software
20
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
21
24
  # ****************************************************************************
22
25
 
23
26
  from __future__ import division, print_function
@@ -152,10 +155,7 @@ class Rational (autosuper) :
152
155
  other = self.__class__ (other)
153
156
  p = self.p * other.q
154
157
  q = self.q * other.p
155
- if q < 0 :
156
- p = -p
157
- q = -q
158
- return self.__class__ (p, q)
158
+ return p // q
159
159
  # end def __floordiv__
160
160
 
161
161
  def __rfloordiv__ (self, other) :
@@ -164,6 +164,23 @@ class Rational (autosuper) :
164
164
  return other // self
165
165
  # end def __rfloordiv__
166
166
 
167
+ def __truediv__ (self, other) :
168
+ if not isinstance (other, self.__class__) :
169
+ other = self.__class__ (other)
170
+ p = self.p * other.q
171
+ q = self.q * other.p
172
+ if q < 0 :
173
+ p = -p
174
+ q = -q
175
+ return self.__class__ (p, q)
176
+ # end def __truediv__
177
+
178
+ def __rtruediv__ (self, other) :
179
+ if not isinstance (other, self.__class__) :
180
+ other = self.__class__ (other)
181
+ return other / self
182
+ # end def __rtruediv__
183
+
167
184
  def __int__ (self) :
168
185
  return int (self.p // self.q)
169
186
  # end def __int__
@@ -193,10 +210,6 @@ class Rational (autosuper) :
193
210
  return self + other
194
211
  # end def __radd__
195
212
 
196
- def __rdiv__ (self, other) :
197
- return self.__class__ (other) // self
198
- # end def __rdiv__
199
-
200
213
  def __repr__ (self) :
201
214
  if self.q == 1 :
202
215
  return "%d" % self.p
rsclib/sqlparser.py CHANGED
@@ -5,19 +5,23 @@
5
5
  # Web: http://www.runtux.com Email: office@runtux.com
6
6
  # All rights reserved
7
7
  # ****************************************************************************
8
- # This library is free software; you can redistribute it and/or modify
9
- # it under the terms of the GNU Library General Public License as
10
- # published by the Free Software Foundation; either version 2 of the
11
- # License, or (at your option) any later version.
8
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ # of this software and associated documentation files (the "Software"), to deal
10
+ # in the Software without restriction, including without limitation the rights
11
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ # copies of the Software, and to permit persons to whom the Software is
13
+ # furnished to do so, subject to the following conditions:
12
14
  #
13
- # This program is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU Library General Public License for more details.
15
+ # The above copyright notice and this permission notice shall be included in
16
+ # all copies or substantial portions of the Software.
17
17
  #
18
- # You should have received a copy of the GNU Library General Public
19
- # License along with this program; if not, write to the Free Software
20
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ # SOFTWARE.
21
25
  # ****************************************************************************
22
26
 
23
27
  from __future__ import print_function