Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions nyx/panel/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import os
import platform
import time

import stem
Expand Down Expand Up @@ -287,8 +288,8 @@ def create(last_sampling = None):
'memory': stem.util.str_tools.size_label(tor_resources.memory_bytes) if tor_resources.memory_bytes > 0 else 0,
'memory_percent': '%0.1f' % (100 * tor_resources.memory_percent),

'hostname': os.uname()[1],
'platform': '%s %s' % (os.uname()[0], os.uname()[2]), # [platform name] [version]
'hostname': platform.uname()[1],
'platform': '%s %s' % (platform.uname()[0], platform.uname()[2]), # [platform name] [version]
}

return Sampling(**attr)
Expand Down
2 changes: 1 addition & 1 deletion nyx/starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def _warn_if_root(controller):

if controller.get_user(None) == 'root':
stem.util.log.notice("Tor is currently running with root permissions. This isn't a good idea, nor should it be necessary. See the 'User UID' option on Tor's man page for an easy method of reducing its permissions after startup.")
elif os.getuid() == 0:
elif os.name == 'posix' and os.getuid() == 0:
stem.util.log.notice("Nyx is currently running with root permissions. This isn't a good idea, nor should it be necessary.")


Expand Down
3 changes: 2 additions & 1 deletion nyx/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

import collections
import os
import platform
import time
import threading

Expand Down Expand Up @@ -517,7 +518,7 @@ def __init__(self, rate):
elif not self._resolvers:
stem.util.log.notice("Tor connection information is unavailable. This is fine, but if you would like to have it please see https://nyx.torproject.org/#no_connections")

stem.util.log.info('Operating System: %s, Connection Resolvers: %s' % (os.uname()[0], ', '.join(self._resolvers)))
stem.util.log.info('Operating System: %s, Connection Resolvers: %s' % (platform.uname()[0], ', '.join(self._resolvers)))

def _task(self, process_pid, process_name):
if self._custom_resolver:
Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import re
import sys
import platform

if '--dryrun' in sys.argv:
DRY_RUN = True
Expand Down Expand Up @@ -67,6 +68,11 @@
with open('MANIFEST.in', 'w') as manifest_file:
manifest_file.write(MANIFEST)

# Detect if the system is Windows
extra_install_requires = []
if platform.system() == 'Windows':
extra_install_requires.append('windows-curses')

try:
setuptools.setup(
name = 'nyx-dry-run' if DRY_RUN else 'nyx',
Expand All @@ -79,7 +85,7 @@
url = ATTR['url'],
packages = ['nyx', 'nyx.panel'],
keywords = 'tor onion controller',
install_requires = ['stem>=1.7.0'],
install_requires = ['stem>=1.7.0'] + extra_install_requires,
package_data = {'nyx': ['settings/*']},
entry_points = {'console_scripts': ['nyx = nyx.__init__:main']},
classifiers = [
Expand Down