GithubHelp home page GithubHelp logo

workon's Introduction

workon

"Samkoda" - Social coding experiment

image

Above: screenshot of workon client script running on Ubuntu

Background

Me and my samkoda friend have been discussing that sometimes you get the urge to build on your project, but do not have the energy to share on WhatsApp, Slack, Discord IRC or wherever you communicate with coding buddies. This is due to both not wanting to potentially interrupt/disturb, but also that it takes energy to write stuff, however small. :)

Instead, we would like to see each others statuses 'somewhere' when you start coding; similar to how the Friends view in Steam works for games! This has some consequences:

  1. It will not disturb/interrupt anyone
  2. There is no energy loss having to type 'do you want to code some with me now?'

Install and run client

  1. Make sure you have Python 3.6+ available
  2. Download "client/workon.py"
  3. In a terminal, write:
python3 workon.py <projectname>

Then follow instructions!

Below untranslated How-to for Windows .bat file

Hur bygger man en .bat fil som startar ens editor och en PowerShell i projektets .venv?

  1. Ändra på cmdline= raden i mittprojekt.ini till hela sökvägen till editorn. Viktigt: "..." runtom!
  2. Bygg en mittprojekt.bat fil som pekar ut Activate.ps1 och kör workon
start powershell.exe -noexit -file "mittprojekt\venv\Scripts\Activate.ps1"
python workon.py mittprojekt

Exempel på struktur på hårddisken:

  • C:\projekt\MittProjekt\
    • Här ligger projektets filer
  • C:\projekt\MittProjekt\venv
    • Virtuell environment för projektet
  • C:\projekt\workon.py
    • workon ligger "ovanför"
  • C:\projekt\mittprojekt.ini
    • workon-cfg-script
  • C:\projekt\mittprojekt.bat
    • startscript

Hur kör man klienttesterna?

cd client
python3 test_client.py

Hur kör man servern?

TBD

workon's People

Contributors

objarni avatar

Watchers

 avatar

workon's Issues

Spammy terminal output

When starting e.g goland, there are a lot of java:ish error output onto the terminal.

It looks sad.

No timestamp visible in status display

To get a feeling 'this is now', it would be nice to see a timestamp or at least clock in the status display, something like:

** Status 18:01**
olof is working on rescue

No way to list all configurations available on machine

ATM I need to remember the project names of workon projects I've configured.

If the configuration files were stored in ~/.workon/*.ini or similar one could imagine doing:

$ workon

... which would simply list the available projects:

1. rescue
2. polarbear

Script exits if running for long time (4+ hours?)

When leaving the script + editor for a whole day at a computer (by mistake actually), I found this error when I came back:

** Status **
olof is working on rescue.




Traceback (most recent call last):
  File "/usr/lib/python3.8/urllib/request.py", line 1350, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 950, in send
    self.connect()
  File "/usr/lib/python3.8/http/client.py", line 921, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.8/socket.py", line 808, in create_connection
    raise err
  File "/usr/lib/python3.8/socket.py", line 796, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/olof/repos/github/workon/client/workon.py", line 120, in <module>
    run_cmd_line(args, url)
  File "/home/olof/repos/github/workon/client/workon.py", line 81, in run_cmd_line
    http_get(heartbeat_url)
  File "/home/olof/repos/github/workon/client/workon.py", line 90, in http_get
    with urllib.request.urlopen(url) as response:
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1379, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.8/urllib/request.py", line 1353, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

I think there must have been some sort of network issue during the day, which quit the script (but the editor was still running).

It would probably make sense to make the script just ignore this kind of network error?

Script exits if editor already running

If goland is already running, I get this error message when typing "workon rescue":

** Status **
olof is working on rescue.




Already running

.. and then the script exits.

What is expected behaviour? Not sure

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.