New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python3 fixes #99
Python3 fixes #99
Commits on Jan 3, 2020
-
- Set the log dir mode with mkdir. - Use Type=exec, it's more resilient to some failures (i.e. absent binary). - Use a better name - Use the default dependencies which seemed to be duplicated here anyway. Remove nonexistent syslog.target - Remove PIDFile. It's unnecessary and systemd doesn't use it except for units of Type=forking - Use a slower RestartSec (the default of 100ms is probably inappropriate)
Configuration menu - View commit details
-
Copy full SHA for a35f9ff - Browse repository at this point
Copy the full SHA a35f9ffView commit details -
Calls to logging functions should use %s/%d/etc and pass parameters instead of interpolating first. The logging module can avoid doing that work if the log message would be filtered anyway.
Configuration menu - View commit details
-
Copy full SHA for 51a3c18 - Browse repository at this point
Copy the full SHA 51a3c18View commit details -
- Avoid import * - Use setdefault for dict initialisation. - Remove/simplify various bits.
Configuration menu - View commit details
-
Copy full SHA for 579a4a4 - Browse repository at this point
Copy the full SHA 579a4a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 724e5ae - Browse repository at this point
Copy the full SHA 724e5aeView commit details -
This class is only ever a ConfigObj wrapper, so remove the json code.
Configuration menu - View commit details
-
Copy full SHA for 45bfe44 - Browse repository at this point
Copy the full SHA 45bfe44View commit details -
Add log_backup_count and log_max_bytes settings.
This adds config options to control the log file rotation.
Configuration menu - View commit details
-
Copy full SHA for a360874 - Browse repository at this point
Copy the full SHA a360874View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5269897 - Browse repository at this point
Copy the full SHA 5269897View commit details -
This import mechanism is fragile and needs to be converted into a true module. Revert this for now.
Configuration menu - View commit details
-
Copy full SHA for ddbaa09 - Browse repository at this point
Copy the full SHA ddbaa09View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab0beaa - Browse repository at this point
Copy the full SHA ab0beaaView commit details -
This means that emonhub shuts down cleanly when stopped by, e.g., systemd.
Configuration menu - View commit details
-
Copy full SHA for ada3181 - Browse repository at this point
Copy the full SHA ada3181View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4137587 - Browse repository at this point
Copy the full SHA 4137587View commit details -
Configuration menu - View commit details
-
Copy full SHA for ba2835d - Browse repository at this point
Copy the full SHA ba2835dView commit details -
- Standard library imports should go first. - Remove unused or duplicate imports.
Configuration menu - View commit details
-
Copy full SHA for 9e3661b - Browse repository at this point
Copy the full SHA 9e3661bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9153ab2 - Browse repository at this point
Copy the full SHA 9153ab2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e636c6 - Browse repository at this point
Copy the full SHA 0e636c6View commit details -
- expr == False -> not expr - expr == True -> expr (or expr is True, if the type isn't clear). - not x in y => x not in y - not x == "1" => x != "1" - omit range default - 'if not x or not y: pass else: z' => 'if x and y: z' - str.__len__ => len - x > 1 and x < 10 => 1 < x < 10 - not x > y => x <= y - if x: if y: if z: _ => if x and y and x: _ - BUGFIX: "a" and "b" in f => all(i in f for i in ["a","b"]) - BUGFIX: .lower => .lower()
Configuration menu - View commit details
-
Copy full SHA for dd8d1f7 - Browse repository at this point
Copy the full SHA dd8d1f7View commit details -
- defaultdict to avoid initialising every entry up front - Use struct.calcsize instead of copying the values. - if x == 0: y = False: else y = True => y = bool(x) - list[len(list)-1] => list[-1] - math.pow(256, 1) => 0x08 etc. - x = bytearray(); x.append(y); x.append(z) => x = bytearray([y, z]) - value = x; return value => return x
1Configuration menu - View commit details
-
Copy full SHA for e003356 - Browse repository at this point
Copy the full SHA e003356View commit details -
Configuration menu - View commit details
-
Copy full SHA for 41364ec - Browse repository at this point
Copy the full SHA 41364ecView commit details -
- Create dicts at compile time. - Use startswith as it's less error prone. - Add some FIXMEs. - Make dict at compile time. - Use enumerate. - Lift sum out of if blocks.
Configuration menu - View commit details
-
Copy full SHA for 7d680f2 - Browse repository at this point
Copy the full SHA 7d680f2View commit details -
Use requests instead of urllib2.
It's much easier to use and it didn't change from python2 to python3. I can't easily test PacketGen, though, but it seems to be unused.
Configuration menu - View commit details
-
Copy full SHA for 7f0253a - Browse repository at this point
Copy the full SHA 7f0253aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fe771b - Browse repository at this point
Copy the full SHA 5fe771bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 03fb179 - Browse repository at this point
Copy the full SHA 03fb179View commit details -
Configuration menu - View commit details
-
Copy full SHA for f9359e0 - Browse repository at this point
Copy the full SHA f9359e0View commit details -
We were passing a string where an integer port number was expected. Add a cast.
Configuration menu - View commit details
-
Copy full SHA for 844890f - Browse repository at this point
Copy the full SHA 844890fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 87b1ecc - Browse repository at this point
Copy the full SHA 87b1eccView commit details -
Configuration menu - View commit details
-
Copy full SHA for b441fd3 - Browse repository at this point
Copy the full SHA b441fd3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5171fdd - Browse repository at this point
Copy the full SHA 5171fddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8199e31 - Browse repository at this point
Copy the full SHA 8199e31View commit details -
This code shouldn't really be relying on division, but change it to return an integer anyway.
Configuration menu - View commit details
-
Copy full SHA for d5dfb0f - Browse repository at this point
Copy the full SHA d5dfb0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e4387ec - Browse repository at this point
Copy the full SHA e4387ecView commit details -
- Set the log dir mode with mkdir. - Use Type=exec, it's more resilient to some failures (i.e. absent binary). - Use a better name - Use the default dependencies which seemed to be duplicated here anyway. Remove nonexistent syslog.target - Remove PIDFile. It's unnecessary and systemd doesn't use it except for units of Type=forking - Use a slower RestartSec (the default of 100ms is probably inappropriate)
Configuration menu - View commit details
-
Copy full SHA for a164904 - Browse repository at this point
Copy the full SHA a164904View commit details -
Calls to logging functions should use %s/%d/etc and pass parameters instead of interpolating first. The logging module can avoid doing that work if the log message would be filtered anyway.
Configuration menu - View commit details
-
Copy full SHA for b0082b7 - Browse repository at this point
Copy the full SHA b0082b7View commit details -
- Avoid import * - Use setdefault for dict initialisation. - Remove/simplify various bits.
Configuration menu - View commit details
-
Copy full SHA for 9b5f5d7 - Browse repository at this point
Copy the full SHA 9b5f5d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for c717867 - Browse repository at this point
Copy the full SHA c717867View commit details -
This class is only ever a ConfigObj wrapper, so remove the json code.
Configuration menu - View commit details
-
Copy full SHA for a594bf3 - Browse repository at this point
Copy the full SHA a594bf3View commit details -
Add log_backup_count and log_max_bytes settings.
This adds config options to control the log file rotation.
Configuration menu - View commit details
-
Copy full SHA for 4ba3b0f - Browse repository at this point
Copy the full SHA 4ba3b0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 55401f2 - Browse repository at this point
Copy the full SHA 55401f2View commit details -
This import mechanism is fragile and needs to be converted into a true module. Revert this for now.
Configuration menu - View commit details
-
Copy full SHA for 1192a11 - Browse repository at this point
Copy the full SHA 1192a11View commit details -
Configuration menu - View commit details
-
Copy full SHA for 039e350 - Browse repository at this point
Copy the full SHA 039e350View commit details -
Merge branch 'python3-fixes' of https://github.com/bwduncan/emonhub i…
…nto python3-fixes
Configuration menu - View commit details
-
Copy full SHA for 29ae56c - Browse repository at this point
Copy the full SHA 29ae56cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d1e67e9 - Browse repository at this point
Copy the full SHA d1e67e9View commit details
Commits on Aug 19, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 07a5abd - Browse repository at this point
Copy the full SHA 07a5abdView commit details -
Merge branch 'python3-fixes' of https://github.com/bwduncan/emonhub i…
…nto python3-fixes
Configuration menu - View commit details
-
Copy full SHA for 5311c50 - Browse repository at this point
Copy the full SHA 5311c50View commit details